Every formal grammar defines a language and can in principle be used in three ways: to generate strings (production), to recognize them (parsing), or -- given only examples -- to infer the grammar itself (grammar induction). Generation and recognition are extensionally equivalent -- they characterize the same set -- but operationally asymmetric in multiple independent ways. Inference is a qualitatively harder problem: it does not have access to a known grammar. Despite the centrality of this triad to compiler design, natural language processing, and formal language theory, no survey has treated it as a unified, multidimensional phenomenon. We identify six dimensions along which generation and recognition diverge: computational complexity, ambiguity, directionality, information availability, grammar inference, and temporality. We show that the common characterization "generation is easy, parsing is hard" is misleading: unconstrained generation is trivial, but generation under constraints can be NP-hard. The real asymmetry is that parsing is always constrained (the input is given) while generation need not be. Two of these dimensions -- directionality and temporality -- have not previously been identified as dimensions of the generation-recognition asymmetry. We connect the temporal dimension to the surprisal framework of Hale (2001) and Levy (2008), arguing that surprisal formalizes the temporal asymmetry between a generator (surprisal = 0) and a parser that predicts under uncertainty (surprisal > 0). We review bidirectional systems in NLP and observe that bidirectionality has been available for fifty years yet has not transferred to most domain-specific applications. We conclude with a discussion of large language models, which architecturally unify generation and recognition while operationally preserving the asymmetry.
翻译:每个形式文法都定义了一种语言,原则上可通过三种方式使用:生成字符串(产生式)、识别字符串(解析)或仅根据示例推断文法本身(文法归纳)。生成与识别在外延上等价——它们表征相同的集合——但在多个独立维度上存在操作不对称性。归纳是一个本质上更难的问题:它无法获取已知文法。尽管这一三元组在编译器设计、自然语言处理和形式语言理论中具有核心地位,但尚无综述将其视为统一的多维现象。我们识别出生成与识别在六个维度上的分歧:计算复杂度、歧义性、方向性、信息可用性、文法归纳及时序性。研究表明,“生成容易,解析困难”这一常见表述具有误导性:无约束生成是平凡的,但带约束生成可能是NP难的。真正的非对称性在于:解析始终受约束(输入已给定),而生成则未必。其中两个维度——方向性与时序性——此前未被识别为生成-识别不对称性的维度。我们将时序维度与Hale(2001)和Levy(2008)的惊奇度框架相联系,论证惊奇度形式化了生成器(惊奇度=0)与在不确定性下进行预测的解析器(惊奇度>0)之间的时序不对称性。我们综述了NLP中的双向系统,观察到双向性虽已存在五十年,却未推广至大多数领域特定应用。最后讨论了大语言模型——其在架构上统一了生成与识别,但在操作层面仍保留着这种不对称性。