用大模型生成代码特征,训练可解释的树模型,媲美神经网络。
Programmatic Representation Learning with Language Models
- 用大模型生成代码形式的特征函数,结合决策树做预测。
- 在棋局评估、图像与文本分类任务中达到接近神经网络的准确率。
- 结果可读性强,适合需要透明决策过程的场景。
传统监督学习模型如决策树高效且可解释,但性能高度依赖输入特征选择。神经网络虽能从原始数据中自动学习表示,却牺牲了可解释性并需专用硬件支持。本文提出一种名为学习型程序表示(LeaPR)的新范式,将任意以代码形式表示的特征函数(从数据点到标量的映射)与决策树预测器堆叠。利用大语言模型(LLM)生成特征函数,因其具备广泛领域的先验知识和编写代码的能力。我们设计两种算法:一是对FunSearch的改进,用于学习特征而非直接生成预测器;二是新型ID3变体,在叶节点分裂时按需生成新特征。实验涵盖国际象棋局面评估、图像与文本分类,所提方法获得无需神经网络的高质量预测器,性能常可媲美神经网络。该工作展示了一种端到端可解释表示学习的灵活框架,特征与预测结果均可直观检查与理解。
原文摘要 · Abstract (English)
Classical models for supervised machine learning, such as decision trees, are efficient and interpretable predictors, but their quality is highly dependent on the particular choice of input features. Although neural networks can learn useful representations directly from raw data (e.g., images or text), this comes at the expense of interpretability and the need for specialized hardware to run them efficiently. In this paper, we explore a hypothesis class we call Learned Programmatic Representations (LeaPR) models, which stack arbitrary features represented as code (functions from data points to scalars) and decision tree predictors. We synthesize feature functions using Large Language Models (LLMs), which have rich prior knowledge in a wide range of domains and a remarkable ability to write code using existing domain-specific libraries. We propose two algorithms to learn LeaPR models from supervised data. First, we design an adaptation of FunSearch to learn features rather than directly generate predictors. Then, we develop a novel variant of the classical ID3 algorithm for decision tree learning, where new features are generated on demand when splitting leaf nodes. In experiments from chess position evaluation to image and text classification, our methods learn high-quality, neural network-free predictors often competitive with neural networks. Our work suggests a flexible paradigm for learning interpretable representations end-to-end where features and predictions can be readily inspected and understood.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。