From Reasoning Traces to Reusable Modules: Understanding Compositional Generalization in Language Model Reasoning

Lingjing Kong, Xin Liu, Guangyi Chen, Martin Q. Ma, Xiangchen Song, Yuekai Sun, Mikhail Yurochkin, Taylor W. Killian, Ruslan Salakhutdinov, Kun Zhang, Eric P. Xing, Zhengzhong Liu
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:60023-60050, 2026.

Abstract

Reinforcement learning (RL) has emerged as a key mechanism for transforming LLMs into robust reasoners. While supervised fine-tuning (SFT) often limits models to the distribution of observed reasoning traces, RL post-training significantly improves performance on out-of-distribution (OOD) tasks that require unfamiliar recombinations of familiar steps. We argue that this improvement is driven by compositional generalization, which we formalize through a Hierarchical Latent Selection Model. In this framework, reasoning traces are generated by a cascade of discrete latent selection variables corresponding to reusable atomic modules, including both skills (local operations) and routing mechanisms (how intermediate information is selected, reused, and composed). We theoretically show that RL’s exploratory nature provides sufficient coverage to identify latent structure and enable compositional generalization. We design controlled experiments to validate this theory. Our results demonstrate that RL can extract atomic modules from compound traces and recombine them to solve new configurations. Moreover, we find that training on compound traces can yield stronger generalization than training on isolated atomic modules. Finally, we investigate relations between SFT and RL and identify an effective protocol in which SFT ensures coverage of all atomic modules, while RL focuses on novel compositions beyond the SFT support to encourage exploration.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-kong26c, title = {From Reasoning Traces to Reusable Modules: Understanding Compositional Generalization in Language Model Reasoning}, author = {Kong, Lingjing and Liu, Xin and Chen, Guangyi and Ma, Martin Q. and Song, Xiangchen and Sun, Yuekai and Yurochkin, Mikhail and Killian, Taylor W. and Salakhutdinov, Ruslan and Zhang, Kun and Xing, Eric P. and Liu, Zhengzhong}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {60023--60050}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/kong26c/kong26c.pdf}, url = {https://proceedings.mlr.press/v306/kong26c.html}, abstract = {Reinforcement learning (RL) has emerged as a key mechanism for transforming LLMs into robust reasoners. While supervised fine-tuning (SFT) often limits models to the distribution of observed reasoning traces, RL post-training significantly improves performance on out-of-distribution (OOD) tasks that require unfamiliar recombinations of familiar steps. We argue that this improvement is driven by compositional generalization, which we formalize through a Hierarchical Latent Selection Model. In this framework, reasoning traces are generated by a cascade of discrete latent selection variables corresponding to reusable atomic modules, including both skills (local operations) and routing mechanisms (how intermediate information is selected, reused, and composed). We theoretically show that RL’s exploratory nature provides sufficient coverage to identify latent structure and enable compositional generalization. We design controlled experiments to validate this theory. Our results demonstrate that RL can extract atomic modules from compound traces and recombine them to solve new configurations. Moreover, we find that training on compound traces can yield stronger generalization than training on isolated atomic modules. Finally, we investigate relations between SFT and RL and identify an effective protocol in which SFT ensures coverage of all atomic modules, while RL focuses on novel compositions beyond the SFT support to encourage exploration.} }
Endnote
%0 Conference Paper %T From Reasoning Traces to Reusable Modules: Understanding Compositional Generalization in Language Model Reasoning %A Lingjing Kong %A Xin Liu %A Guangyi Chen %A Martin Q. Ma %A Xiangchen Song %A Yuekai Sun %A Mikhail Yurochkin %A Taylor W. Killian %A Ruslan Salakhutdinov %A Kun Zhang %A Eric P. Xing %A Zhengzhong Liu %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-kong26c %I PMLR %P 60023--60050 %U https://proceedings.mlr.press/v306/kong26c.html %V 306 %X Reinforcement learning (RL) has emerged as a key mechanism for transforming LLMs into robust reasoners. While supervised fine-tuning (SFT) often limits models to the distribution of observed reasoning traces, RL post-training significantly improves performance on out-of-distribution (OOD) tasks that require unfamiliar recombinations of familiar steps. We argue that this improvement is driven by compositional generalization, which we formalize through a Hierarchical Latent Selection Model. In this framework, reasoning traces are generated by a cascade of discrete latent selection variables corresponding to reusable atomic modules, including both skills (local operations) and routing mechanisms (how intermediate information is selected, reused, and composed). We theoretically show that RL’s exploratory nature provides sufficient coverage to identify latent structure and enable compositional generalization. We design controlled experiments to validate this theory. Our results demonstrate that RL can extract atomic modules from compound traces and recombine them to solve new configurations. Moreover, we find that training on compound traces can yield stronger generalization than training on isolated atomic modules. Finally, we investigate relations between SFT and RL and identify an effective protocol in which SFT ensures coverage of all atomic modules, while RL focuses on novel compositions beyond the SFT support to encourage exploration.
APA
Kong, L., Liu, X., Chen, G., Ma, M.Q., Song, X., Sun, Y., Yurochkin, M., Killian, T.W., Salakhutdinov, R., Zhang, K., Xing, E.P. & Liu, Z.. (2026). From Reasoning Traces to Reusable Modules: Understanding Compositional Generalization in Language Model Reasoning. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:60023-60050 Available from https://proceedings.mlr.press/v306/kong26c.html.

Related Material