Table of Contents
Fetching ...

Can Large Language Models Generalize Procedures Across Representations?

Fangru Lin, Valentin Hofmann, Xingchen Wan, Weixing Wang, Zifeng Ding, Anthony G. Cohn, Janet B. Pierrehumbert

TL;DR

This work investigates whether LLMs can generalize procedures learned in symbolic representations (Graph/Code) to natural language tasks, using isomorphic data designs for asynchronous planning. It shows that standard post-training on symbolic data yields weak cross-representation transfer to NL, while a two-stage curriculum that first trains symbolically and then adapts to NL substantially improves cross-representation generalization across model families, achieving near parity with zero-shot GPT-4o on NL planning tasks. The authors argue that successful cross-representation generalization is best explained as generative analogy rather than frequency-based transfer, and demonstrate that their curriculum promotes this analogical reasoning. The findings highlight a practical path to robust cross-representation generalization in LLMs and underscore a cognitive perspective on analogy, with implications for scaling and curriculum design in reasoning tasks.

Abstract

Large language models (LLMs) are trained and tested extensively on symbolic representations such as code and graphs, yet real-world user tasks are often specified in natural language. To what extent can LLMs generalize across these representations? Here, we approach this question by studying isomorphic tasks involving procedures represented in code, graphs, and natural language (e.g., scheduling steps in planning). We find that training LLMs with popular post-training methods on graphs or code data alone does not reliably generalize to corresponding natural language tasks, while training solely on natural language can lead to inefficient performance gains. To address this gap, we propose a two-stage data curriculum that first trains on symbolic, then natural language data. The curriculum substantially improves model performance across model families and tasks. Remarkably, a 1.5B Qwen model trained by our method can closely match zero-shot GPT-4o in naturalistic planning. Finally, our analysis suggests that successful cross-representation generalization can be interpreted as a form of generative analogy, which our curriculum effectively encourages.

Can Large Language Models Generalize Procedures Across Representations?

TL;DR

This work investigates whether LLMs can generalize procedures learned in symbolic representations (Graph/Code) to natural language tasks, using isomorphic data designs for asynchronous planning. It shows that standard post-training on symbolic data yields weak cross-representation transfer to NL, while a two-stage curriculum that first trains symbolically and then adapts to NL substantially improves cross-representation generalization across model families, achieving near parity with zero-shot GPT-4o on NL planning tasks. The authors argue that successful cross-representation generalization is best explained as generative analogy rather than frequency-based transfer, and demonstrate that their curriculum promotes this analogical reasoning. The findings highlight a practical path to robust cross-representation generalization in LLMs and underscore a cognitive perspective on analogy, with implications for scaling and curriculum design in reasoning tasks.

Abstract

Large language models (LLMs) are trained and tested extensively on symbolic representations such as code and graphs, yet real-world user tasks are often specified in natural language. To what extent can LLMs generalize across these representations? Here, we approach this question by studying isomorphic tasks involving procedures represented in code, graphs, and natural language (e.g., scheduling steps in planning). We find that training LLMs with popular post-training methods on graphs or code data alone does not reliably generalize to corresponding natural language tasks, while training solely on natural language can lead to inefficient performance gains. To address this gap, we propose a two-stage data curriculum that first trains on symbolic, then natural language data. The curriculum substantially improves model performance across model families and tasks. Remarkably, a 1.5B Qwen model trained by our method can closely match zero-shot GPT-4o in naturalistic planning. Finally, our analysis suggests that successful cross-representation generalization can be interpreted as a form of generative analogy, which our curriculum effectively encourages.
Paper Structure (49 sections, 1 equation, 7 figures, 5 tables)

This paper contains 49 sections, 1 equation, 7 figures, 5 tables.

Figures (7)

  • Figure 1: Illustration of cross-representation generalization of the planning task studied in this paper. Each frame describes a question and its corresponding underlying graph problems as well as their solutions (critical paths in red). The top frame describes a natural language planning problem in NL, where the problem is given in natural language. Essentially, the shortest time needed for this task can be solved by formalizing the constraints of the problem as a DAG and calculating the longest directed path. The bottom part describes two other proxies, namely Graph and Code. Both proxies share exactly the same procedures as NL and can be solved by the same algorithms. The only difference is the representation format. See detailed prompt illustrations in Appendix \ref{['sec:prompt_example']}.
  • Figure 2: Qwen models' performance after training. We train models on one representation from NL, Graph, and Code, respectively (left to right), and test them on all representations (with the particular aim to optimize on NL). Results in orange background are in the same distribution as the training set (e.g., train on NL and test on NL). Up/down arrows denote test results significantly better/worse than untuned baselines by McNemar’s tests mcnemar1947note. Models generally cannot transfer learned procedures in Code and Graph to NL, despite showing high within-representation performance (delta results in Appendix \ref{['sec:full_detailed_res']}).
  • Figure 3: Main results for Llama models after training. We train models on one training set from NL, Graph, and Code, respectively (left to right), and test them on all settings (with the particular aim to optimize on NL representations). Results in orange background are in the same distribution as the training set (e.g., train on NL and test on NL). Up/down arrows denote test results significantly better/worse than untuned baselines by McNemar’s tests mcnemar1947note. Llama-1B cannot sample meaningful results for STaR method on Code, so we report the baseline result for the corresponding space. In general, we continue to witness our findings in the main content that there is no meaningful transfer when trained on a single representation.
  • Figure 4: Main results for Olmo models after training. We train models on one training set from NL, Graph, and Code, respectively (left to right), and test them on all settings (with the particular aim to optimize on NL representations). Results in orange background are in the same distribution as the training set (e.g., train on NL and test on NL). Up/down arrows denote test results significantly better/worse than untuned baselines by McNemar’s tests mcnemar1947note. Olmo-1B cannot sample meaningful results for STaR method, so we report the baseline result for the corresponding space. In general, we continue to witness our findings in the main content that there is no meaningful transfer when trained on a single representation.
  • Figure 5: Reward curve for NL, Graph training from cold start, and (Graph->)NL which is NL training initialized with the final checkpoint of Graph. The learning curve of (Graph->)NL resembles Graph more than NL.
  • ...and 2 more figures