自回归马赛克:探究纯文本语言模型中的二维空间推理

·

研究论文 · 2026/09/03

仅使用文本和代码训练的大型语言模型有时能生成绘制可识别图像的程序,但这是否反映其内部具有二维空间布局的表征尚不明确。我们提出了Autoregressive Mosaics(AM-Bench)基准,通过分离翻译任务和布局任务来探究这一问题。实验发现,所有模型都能可靠地将指定几何翻译为代码,但开放式布局性能差异显著,且这种差异不能仅由代码生成能力解释。输出媒介的消融实验表明,使用原始SVG比程序化代码能提高所有模型的布局分数。激活探测显示,生成前存在粗略的布局计划,但仅反映提示隐含的布局;生成过程中,模型跟踪演变的几何状态而非执行初始固定计划。总之,文本-only LLM的二维空间性能取决于模型和输出媒介,且不能仅由代码生成能力解释。

该研究通过精心设计的基准和实验,揭示了文本-only LLM在二维空间推理上的真实能力,挑战了仅凭代码生成能力解释空间表现的假设,为理解模型内部表征提供了新视角。

Large language models (LLMs) trained only on text and code can sometimes generate programs that draw recognizable images. However, it is unclear whether this reflects an internal representation of 2D spatial layout or simply the ability to translate spatial descriptions into code. We introduce Autoregressive Mosaics (AM-Bench), a benchmark that separates these factors: First, a translation task gives a model a fully specified geometry of a picture in words as a prompt and asks for the code that produces it. Second, a layout task requires the model to compose an image from an underspecified prompt. Across eight open-weight text-and-code-only models, all models reliably translate specified geometry into code, but their open-ended layout performance differs substantially, indicating that these differences are not explained by code-generation ability alone. An output-medium ablation further shows that the interface or medium of expression that the model uses matters: replacing procedural code with raw SVG improves layout scores across all models. Finally, probing model activations shows that a coarse layout plan is present before generation, but reflects only the layout implied by the prompt. During generation, models track the evolving geometric state instead of executing an initially fixed plan. Overall, these results show that 2D spatial performance in text-only LLMs depends on both the model and the output medium, and is not explained by code-generation ability alone.

阅读原文

参与讨论