arXiv:2510.15987cs.LGcs.AI2025-10被引 6

发现大模型推理本质是潜空间中的算法操作组合。

AlgoTrace: Algorithmic Primitives and Compositional Geometry of Reasoning in Language Models

  • 通过聚类激活态识别推理中的基础算法单元。
  • 注入特定向量可触发对应算法行为并跨任务引导推理。
  • 算法单元可像积木一样组合,形成几何逻辑结构。

大语言模型如何通过推理时的潜在计算解决多步推理问题?我们提出 AlgoTrace 框架,用于追踪和操控模型潜空间中的算法操作。通过对旅行商问题(TSP)、3SAT、AIME 和图导航四个基准任务中模型激活态进行聚类,并用推理轨迹中的对应词元标注聚类结果,我们利用函数向量方法提取出可复用的算法基础单元向量。实验发现:a)将基础单元向量注入模型(Phi、Qwen、Llama)可激发相应的算法操作;b)基础单元可跨任务引导行为;c)基础单元可通过代数运算组合,揭示潜空间中的几何逻辑;d)微调后模型在基础单元组合能力上显著提升(Phi-4-Reasoning vs. Phi-4)。结果表明,大模型推理可被理解为在潜空间中按组合几何规律遍历算法基础单元的过程。这些基础单元具有任务迁移性,而推理微调增强了跨领域算法泛化与组合能力。

原文摘要 · Abstract (English)

How do inference time and latent computations enable large language models (LLMs) to solve multi-step reasoning problems? We introduce AlgoTrace, a framework for tracing and steering algorithmic operations in the model latent space for multi-step reasoning. We operationalize primitives by clustering latent activations of the model when solving four benchmarks: Traveling Salesperson Problem (TSP), 3SAT, AIME, and Graph Navigation. We annotate the clusters using their corresponding tokens in the reasoning trace. We then apply function vector methods to extract primitive vectors as reusable compositional building blocks of reasoning. We find that a) injecting a primitive vector into models (Phi, Qwen, Llama) elicits the associated algorithmic operation in the reasoning trace, b) injecting primitives can steer behavior across tasks, c) primitive vectors can be composed through algebraic operations, revealing a geometric logic in activation space, and d) a fine-tuned model exhibits improved composition of primitives (Phi-4-Reasoning vs. Phi-4). These findings demonstrate that LLM reasoning can be understood as a walk through algorithmic primitives in the latent space governed by compositional geometry. These primitives transfer across tasks, and reasoning finetuning strengthens algorithmic generalization and composition across domains.

大模型推理潜空间分析算法组合可解释性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。