在LLM中诊断CFG解释
Diagnosing CFG Interpretation in LLMs
AI总结:
研究LLM在处理新上下文无关文法时能否生成语法正确、行为功能和语义忠实的输出,揭示LLM在语法、行为和语义层面的层次退化问题。
摘要:
随着LLM越来越多地集成到智能体系统中,它们必须遵守动态定义的、机器可解释的接口。我们评估LLM作为上下文解释器:给定一个新颖的上下文无关文法,LLM能否生成语法正确、行为功能且语义忠实的输出?我们引入RoboGrid框架,通过受控的压力测试递归深度、表达复杂性和表面风格来解耦语法、行为和语义。我们的实验揭示了一种一致的层次退化:LLM通常保持表面语法,但无法保持结构语义。尽管CoT推理部分缓解了这一问题,但在结构密度下性能崩溃,特别是在深度递归和高分支情况下,语义对齐在极端深度消失。此外,“外星”词典表明LLM依赖于关键词的语义引导而非纯粹的符号归纳。这些发现指出了可靠、无语法依赖的智能体所需的关键层次状态跟踪缺口。
英文摘要:
As LLMs are increasingly integrated into agentic systems, they must adhere to dynamically defined, machine-interpretable interfaces. We evaluate LLMs as in-context interpreters: given a novel context-free grammar, can LLMs generate syntactically valid, behaviorally functional, and semantically faithful outputs? We introduce RoboGrid, a framework that disentangles syntax, behavior, and semantics through controlled stress-tests of recursion depth, expression complexity, and surface styles. Our experiments reveal a consistent hierarchical degradation: LLMs often maintain surface syntax but fail to preserve structural semantics. Despite the partial mitigation provided by CoT reasoning, performance collapses under structural density, specifically deep recursion and high branching, with semantic alignment vanishing at extreme depths. Furthermore, "Alien" lexicons reveal that LLMs rely on semantic bootstrapping from keywords rather than pure symbolic induction. These findings pinpoint critical gaps in hierarchical state-tracking required for reliable, grammar-agnostic agents.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。