{"id":"arxiv:2305.13673","title":"Physics of Language Models: Part 1, Learning Hierarchical Language Structures","date":"2023-05-23","section":"Reasoning and the \"physics\" of language models","quality":0.451773,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/","source_url":"https://arxiv.org/abs/2305.13673","text_available":true,"authors":["Zeyuan Allen-Zhu","Yuanzhi Li"],"outgoing":[{"source":"arxiv:2305.13673","target":"arxiv:2207.02098","evidence":"title","id":"arxiv:2207.02098","title":"Neural Networks and the Chomsky Hierarchy","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/6c4e7406c7294ace52a03e4eede4ef1a31cd395dcde0958487fdbb546fa2c026/"},{"source":"arxiv:2305.13673","target":"arxiv:2301.05217","evidence":"id","id":"arxiv:2301.05217","title":"Progress measures for grokking via mechanistic interpretability","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/f71e3b65a8b3f35beb171d17f6c65878e0914227a0042ccba59b88952554baef/"},{"source":"arxiv:2305.13673","target":"arxiv:2309.14316","evidence":"title","id":"arxiv:2309.14316","title":"Physics of Language Models: Part 3.1, Knowledge Storage and Extraction","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/b87376d90e99d2bb590e1a02ed50a55c90881591ed7d3e00c3d5be2aaacbb2af/"},{"source":"arxiv:2305.13673","target":"arxiv:2309.14402","evidence":"title","id":"arxiv:2309.14402","title":"Physics of Language Models: Part 3.2, Knowledge Manipulation","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/79b4d0b92a11dcf3b111e9d2d1b6bb3f516bebce7333326f65e6e583d6ff3cf2/"},{"source":"arxiv:2305.13673","target":"arxiv:2404.05405","evidence":"title","id":"arxiv:2404.05405","title":"Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/541683d3678177bb2800d37a49a2f541c8a2c81cf802eaefe8840fed359c540e/"},{"source":"arxiv:2305.13673","target":"arxiv:2407.20311","evidence":"title","id":"arxiv:2407.20311","title":"Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Process","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/de5db7bc6b929af401b5b83c845823505a7823c25987b0e455231d2e4fcec3e4/"}],"incoming":[{"source":"arxiv:2309.14316","target":"arxiv:2305.13673","evidence":"id","id":"arxiv:2309.14316","title":"Physics of Language Models: Part 3.1, Knowledge Storage and Extraction","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/b87376d90e99d2bb590e1a02ed50a55c90881591ed7d3e00c3d5be2aaacbb2af/"},{"source":"arxiv:2309.14402","target":"arxiv:2305.13673","evidence":"id","id":"arxiv:2309.14402","title":"Physics of Language Models: Part 3.2, Knowledge Manipulation","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/79b4d0b92a11dcf3b111e9d2d1b6bb3f516bebce7333326f65e6e583d6ff3cf2/"},{"source":"arxiv:2312.04927","target":"arxiv:2305.13673","evidence":"id","id":"arxiv:2312.04927","title":"Zoology: Measuring and Improving Recall in Efficient Language Models","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/baa792b06bdd30f91619f1e852aa5ae4dbf688fe3b1f2ee0722b339b9993ac5c/"},{"source":"arxiv:2404.05405","target":"arxiv:2305.13673","evidence":"id","id":"arxiv:2404.05405","title":"Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/541683d3678177bb2800d37a49a2f541c8a2c81cf802eaefe8840fed359c540e/"},{"source":"arxiv:2407.20311","target":"arxiv:2305.13673","evidence":"id","id":"arxiv:2407.20311","title":"Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Process","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/de5db7bc6b929af401b5b83c845823505a7823c25987b0e455231d2e4fcec3e4/"},{"source":"arxiv:2604.17121","target":"arxiv:2305.13673","evidence":"id","id":"arxiv:2604.17121","title":"The Topological Trouble With Transformers","url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/7f9d762bbe192e1208f6d7dc289b7e79c23d4bdde0b1b3999ff5fda55b0dcd1a/"}],"text_parts":[{"start":0,"end":15939,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html"},{"start":15939,"end":31863,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-2.html"},{"start":31863,"end":46911,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-3.html"},{"start":46911,"end":62630,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html"},{"start":62630,"end":78223,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html"},{"start":78223,"end":94048,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html"},{"start":94048,"end":101325,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-7.html"}],"contents":[{"title":"Physics of Language Models: Part 1, Learning Hierarchical Language Structures Thanks: The title Physics of Language Models was jointly conceived and designed by ZA and Xiaoli Xu. V1 appeared on this date; V2 polishes writing and adds Appendix G ; V3 polishes writing and changes the title; V4 improves writing and adds Appendix H (more uniform attention results, May 18, 2025). The first six papers in the Physics of Language Models series were presented as a two-hour tutorial at ICML 2024 in Austria ( youtu.be/yBL7J0kgldU ). A 100-min deep dive into Part 1 is available at youtu.be/kf_eGgVtOcs . Future updates and code release can be found on SSRN and the project page physics.allen-zhu.com . We would like to thank Lin Xiao, Sida Wang and Hu Xu for many helpful conversations. We would like to extend special thanks to Ian Clark, Gourab De, Anmol Mann, and Max Pfeifer from W&B , as well as Nabib Ahmed, Giri Anantharaman, Lucca Bertoncini, Henry Estela, Liao Hu, Caleb Ho, Will Johnson, Apostolos Kokolis, and Shubho Sengupta from Meta FAIR NextSys; without their invaluable support, the experiments in this paper would not have been possible.","offset":0,"level":1,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html#text"},{"title":"Abstract","offset":1153,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html#text"},{"title":"1 Introduction","offset":2673,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html#text"},{"title":"2 Our Synthetic Context-Free Grammars","offset":11025,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html#text"},{"title":"2.1 Definition and Notations","offset":11582,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html#text"},{"title":"Definition 2.1 .","offset":15914,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-1.html#text"},{"title":"2.2 Why Such CFGs","offset":17939,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-2.html#text"},{"title":"3 Results 1-3: Transformer Can Learn Such CFGs","offset":19881,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-2.html#text"},{"title":"4 Results 4-5: How Do Transformers Learn CFGs?","offset":27753,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-2.html#text"},{"title":"4.1 Result 4: Transformer’s Last Layer Encodes NT Ancestors/Boundaries","offset":31787,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-2.html#text"},{"title":"4.2 Result 5: NT Ancestors are Encoded At NT Boundaries","offset":35619,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-3.html#text"},{"title":"5 Results 6-9: How Do Transformers Learn NTs?","offset":39012,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-3.html#text"},{"title":"5.1 Result 6: Position-Based Attention","offset":39336,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-3.html#text"},{"title":"5.2 Result 7-9: Boundary-Based Attention","offset":41210,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-3.html#text"},{"title":"5.3 Connection to Dynamic Programming (DP)","offset":45745,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-3.html#text"},{"title":"6 Results 10-13: Extensions of CFGs","offset":48640,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"6.1 Result 10: Implicit CFGs","offset":48680,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"6.2 Results 11-13: Robustness on Corrupted CFG","offset":51188,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"7 Related Work and Conclusion","offset":56450,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"Appendix A Experiment Setups","offset":59153,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"A.1 Dataset Details","offset":59186,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"Remark A.1 .","offset":61227,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"Remark A.2 .","offset":61749,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"A.2 Model Architecture Details","offset":62594,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-4.html#text"},{"title":"Remark A.3 .","offset":66350,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"A.3 Pre-Training Details","offset":67205,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"A.4 Predict NT ancestor and NT boundary","offset":70017,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"Appendix B More Experiments on Results 2-3 (Generation)","offset":71460,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"B.1 Generation Diversity via Birthday Paradox","offset":73531,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"Definition B.1 .","offset":74186,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"Definition B.2 .","offset":74857,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-5.html#text"},{"title":"B.2 Marginal Distribution Comparison","offset":79577,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Appendix C More Experiments on Results 4-5 (NT Ancestor and Boundary Probing)","offset":80157,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"C.1 NT Ancestor and NT Boundary Probing","offset":80239,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"C.2 NT Probing Across Transformer’s Layers","offset":81559,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"C.3 NT Predictions Across Training Epochs","offset":82052,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Appendix D More Experiments on Results 6-9 (Attention Patterns)","offset":82606,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"D.1 Result 6: Position-Based Attention Pattern","offset":82674,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"D.2 Result 7: From Anywhere to NT-ends","offset":83109,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"D.3 Result 8: From NT-ends to NT-ends","offset":83573,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"D.4 Result 9: From NT-ends to Adjacent NT-ends","offset":84015,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Appendix E More Experiments on Result 10 (Implicit CFGs)","offset":85115,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Appendix F More Experiments on Results 11-13 (Robustness)","offset":86221,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Appendix G Beyond the CFG3 Data Family","offset":86648,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"G.1 The Penn TreeBank CFG","offset":89006,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Remark G.1 .","offset":90150,"level":6,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"G.2 More Synthetic CFGs","offset":92048,"level":3,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-6.html#text"},{"title":"Appendix H More on Uniform Attention","offset":98998,"level":2,"url":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/part-7.html#text"}],"text_code_points":101325,"source_markdown":"https://vinnik-dmitry07.github.io/favorite-papers/agents/papers/a72219d4bd65d1e84ce31079b6c788d7e6c297e71d4b083af5d4cffccfdcff72/source.md"}
