Archive experiment updates 2026-10-08 (41/119)
Browse filesFile-level snapshot; code revision eb6fa2872daec8b3cea3832ee9dfec9e63cf2176. Weights and Docker images remain local.
This view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+22
- results/knowledge-change-v1/tracking-wandb/w730011-shared_full-changed_atomic/state.jsonAdded+10
- results/knowledge-change-v1/tracking-wandb/w730011-shared_full-changed_use/state.jsonAdded+10
- results/knowledge-change-v1/tracking-wandb/w730011-shared_full-fixed/state.jsonAdded+10
- results/knowledge-change-v1/tracking.logAdded
- results/knowledge-change-v1/verification.jsonAdded+35
- results/learning-use-20261007/completion-manifest.jsonAdded+363
- results/learning-use-cloud-audit-20261007/audit-sequential-confirmation.logAdded+33
- results/learning-use-cloud-audit-20261007/audit-sequential-confirmation.pyAdded+151
- results/learning-use-cloud-audit-20261007/audit.logAdded+34
- results/learning-use-cloud-audit-20261007/audit.pyAdded+135
- results/learning-use-runtime-20261007/gpu0.jsonAdded+33
- results/learning-use-runtime-20261007/gpu1.jsonAdded+33
- results/learning-use-runtime-20261007/gpu2.jsonAdded+33
- results/learning-use-runtime-20261007/gpu3.jsonAdded+33
- results/learning-use-runtime-20261007/gpu4.jsonAdded+33
- results/learning-use-runtime-20261007/gpu5.jsonAdded+33
- results/learning-use-runtime-20261007/gpu6.jsonAdded+33
- results/learning-use-runtime-20261007/gpu7.jsonAdded+33
- results/learning-use-runtime-20261007/summary.jsonAdded+46
- results/literature-framing-review-20261007/coconut2025.pdfAdded+3
- results/literature-framing-review-20261007/coconut2025.txtAdded+749
- results/literature-framing-review-20261007/composition-collapse2026.pdfAdded+3
- results/literature-framing-review-20261007/composition-collapse2026.txtAdded+2137
- results/literature-framing-review-20261007/composition2024.pdfAdded+3
- results/literature-framing-review-20261007/composition2024.txtAdded
- results/literature-framing-review-20261007/factual2025.pdfAdded+3
- results/literature-framing-review-20261007/factual2025.txtAdded
- results/literature-framing-review-20261007/grokking2024.pdfAdded+3
- results/literature-framing-review-20261007/grokking2024.txtAdded+1714
- results/literature-framing-review-20261007/hebbian2026.pdfAdded+3
- results/literature-framing-review-20261007/hebbian2026.txtAdded
- results/literature-framing-review-20261007/hopping-late2024.pdfAdded+3
- results/literature-framing-review-20261007/hopping-late2024.txtAdded+1828
- results/literature-framing-review-20261007/implicit2025.pdfAdded+3
- results/literature-framing-review-20261007/implicit2025.txtAdded
- results/literature-framing-review-20261007/latent-multihop2024.pdfAdded+3
- results/literature-framing-review-20261007/latent-multihop2024.txtAdded
- results/literature-framing-review-20261007/literature-notes.jsonAdded+314
- results/literature-framing-review-20261007/loop-horizon2026.pdfAdded+3
- results/literature-framing-review-20261007/loop-horizon2026.txtAdded
- results/literature-framing-review-20261007/loop2025.pdfAdded+3
- results/literature-framing-review-20261007/loop2025.txtAdded
- results/literature-framing-review-20261007/mobius2026.pdfAdded+3
- results/literature-framing-review-20261007/mobius2026.txtAdded+1082
- results/literature-framing-review-20261007/mquake2023.pdfAdded+3
- results/literature-framing-review-20261007/mquake2023.txtAdded+1515
- results/literature-framing-review-20261007/ouro2026.pdfAdded+3
- results/literature-framing-review-20261007/ouro2026.txtAdded
- results/literature-framing-review-20261007/physics31-2024.pdfAdded+3
235 unmodified lines236237238235 unmodified linesdocs/development-artifacts/rippleedits-paper-validation-v2/source/docs/development-artifacts/paper-reproductions-parallel-v1/ripple-upstream/data/benchmark/popular.json filter=lfs diff=lfs merge=lfs -textdocs/development-artifacts/rippleedits-paper-validation-v2/source/docs/development-artifacts/paper-reproductions-parallel-v1/ripple-upstream/data/benchmark/random.json filter=lfs diff=lfs merge=lfs -textdocs/development-artifacts/rippleedits-paper-validation-v2/source/docs/development-artifacts/paper-reproductions-parallel-v1/ripple-upstream/data/benchmark/recent.json filter=lfs diff=lfs merge=lfs -text235 unmodified lines236237238239240241242243244245246247248249250251252253254255256257258259260235 unmodified linesdocs/development-artifacts/rippleedits-paper-validation-v2/source/docs/development-artifacts/paper-reproductions-parallel-v1/ripple-upstream/data/benchmark/popular.json filter=lfs diff=lfs merge=lfs -textdocs/development-artifacts/rippleedits-paper-validation-v2/source/docs/development-artifacts/paper-reproductions-parallel-v1/ripple-upstream/data/benchmark/random.json filter=lfs diff=lfs merge=lfs -textdocs/development-artifacts/rippleedits-paper-validation-v2/source/docs/development-artifacts/paper-reproductions-parallel-v1/ripple-upstream/data/benchmark/recent.json filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/coconut2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/composition-collapse2026.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/composition2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/factual2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/grokking2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/hebbian2026.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/hopping-late2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/implicit2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/latent-multihop2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/loop-horizon2026.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/loop2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/mobius2026.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/mquake2023.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/ouro2026.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/physics31-2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/physics32-2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/physics33-2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/reversal2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/ripple2024.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/scaling-composition2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/socrates2025.pdf filter=lfs diff=lfs merge=lfs -textresults/literature-framing-review-20261007/yao2025.pdf filter=lfs diff=lfs merge=lfs -text
12345678910{ "run_id": "5d235ae7502dc73d", "fingerprint": "5d235ae7502dc73d3d5c7e4e2da23f99b38510e8c595997f278d88677212c9be", "entity": "zhusq20", "project": "llm-memory-editability", "last_logged_step": 32768, "url": "https://wandb.ai/zhusq20/llm-memory-editability/runs/5d235ae7502dc73d", "mode": "online", "wandb_run_id": "5d235ae7502dc73d"}12345678910{ "run_id": "7113bdaa24e9acbc", "fingerprint": "7113bdaa24e9acbcd7e0844f4984e9a7608d63e151dad202249dfd04a9940459", "entity": "zhusq20", "project": "llm-memory-editability", "last_logged_step": 32768, "url": "https://wandb.ai/zhusq20/llm-memory-editability/runs/7113bdaa24e9acbc", "mode": "online", "wandb_run_id": "7113bdaa24e9acbc"}12345678910{ "run_id": "6fe4f645902736ca", "fingerprint": "6fe4f645902736ca6462ada1a8696fadf731dbe8a1c1432373308c32739486e5", "entity": "zhusq20", "project": "llm-memory-editability", "last_logged_step": 32768, "url": "https://wandb.ai/zhusq20/llm-memory-editability/runs/6fe4f645902736ca", "mode": "online", "wandb_run_id": "6fe4f645902736ca"}1234567891011121314151617181920212223242526272829303132333435{ "passed": true, "frozen_sources_unchanged": true, "paired_initialization_and_world_hashes": true, "worlds": [ 730011, 107270011, 107270012, 107270013 ], "related_tests_passed": 31, "eight_gpu_engineering": { "passed": true, "gpus": [ 0, 1, 2, 3, 4, 5, 6, 7 ], "checks": [ true, true, true, true, true, true, true, true ] }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363{ "state": "complete", "checked_utc": "2026-10-07T05:12:55.042938+00:00", "scope": "2026-10-07 authorized sequential transfer and write-target editing experiments", "batches": [ { "batch": "write-target-development-v1", "registered_jobs": 3, "completed_jobs": 3, "independently_audited_jobs": 3, "cloud_verified_jobs": 3, "optimizer_updates": 6144, "sum_recorded_training_seconds": 24.51996061205864, "started_utc": "2026-10-07T04:46:22.492924+00:00", "finished_utc": "2026-10-07T04:46:54.722782+00:00", "frozen_config_sha256": "0a423e4bf917b952296e79582137f80c2bb3dd5afc9f7061c3ebd4738381d5e8", "controller_state_sha256": "f701868d6e9447d163ba69933d6d06b529fbe2a84613e94bf8b7d89c8f007709", "cloud_audit_sha256": "23a72d58f0574c68bb515d61c5a053d97defac2b0ea9944520fcac393feb715f", "report": "results/write-target-development-v1/report/report.md", "report_summary_sha256": "0a0b162e75bf36926ece6e37ab6e3f6c3820bb0aafdeb5a76829d3595a9688a1", "runs": [ { "name": "development-final_ce", "complete_sha256": "f31cdfafa88f8dfb2d108da7cc5a788f7977f6406ca672a8f4a518b2afef021a", "audit_sha256": "4515a919bb630db6ed7c387179a7fb446c7bc7908ed1cf9a7c7f347611439036" }, { "name": "development-early_ce", "complete_sha256": "c34b36a565eb3e83117eb24296967ee4a5c8107bab56c39785c32feb7aa53beb", "audit_sha256": "d194b6c4506f8493b6f8132e053b4da782f74e38597c817f83972d00dc47f6f9" }, { "name": "development-early_ce_align", "complete_sha256": "0d007baf581fa6784a39a06af4d4e726faef9670392e864dd96f6960f0146569", "audit_sha256": "a4e4cdbdd9ca9cc432ef29ff3b6e88925ad69be6a00b95d9b57ea106c04ba511" } ] }, { "batch": "write-target-confirmation-v1", "registered_jobs": 18, "completed_jobs": 18, "independently_audited_jobs": 18, "cloud_verified_jobs": 18, "optimizer_updates": 73728, "sum_recorded_training_seconds": 298.27512392401695, "started_utc": "2026-10-07T04:48:00.809055+00:00", "finished_utc": "2026-10-07T04:50:13.480180+00:00", "frozen_config_sha256": "acf1c17238e06b49876171cc5c83bffd7d5e59b7109f7f74b8514c006db5d3c7", "controller_state_sha256": "367bcd6a5789f115dbfc0c40baaef8dfcab981737e7259501de936ea420a4e46", "cloud_audit_sha256": "9834a2ef2fa5cee1b6e39e8304aeecb34e2cc7d2e87d29275768d01ac2e22de2", "report": "results/write-target-confirmation-v1/report/report.md", "report_summary_sha256": "0344cf737f8e350197ce44c1a963be214dc6d9348502694df2f870ed8c24d149", "runs": [ { "name": "confirmation-w774101-i775101-final_ce", "complete_sha256": "3e0bd44b96b37fff327594a32f9389600d0d67c61ef0b01339343c5368b7f64b", "audit_sha256": "6e757c9ae45f7ae65b337d1c8b09d7bfb149176007e03bcb0f7564ef80eb01ed" }, { "name": "confirmation-w774101-i775101-early_ce", "complete_sha256": "3b92e08730ca1c8b999d0f3555bf009ce0545f4edac3801d2d7eef08300fc2c9", "audit_sha256": "ef3f4aa49b25abe413bd06c12c99aa09d2e5fabbe57de529f466b87ff99b70d8" }, { "name": "confirmation-w774101-i775101-early_ce_align", "complete_sha256": "2782fee261ac5ae49b4ab1161d57edaefe06b30fc225d212cec21b39dadc9daa", "audit_sha256": "c7d542ad031f4a265ef5812ee30f07c6bb15bff8c014b8eb4b170cb1dc60f5b4" }, { "name": "confirmation-w774101-i775102-final_ce", "complete_sha256": "83c79a2d2b3bea41f41c9db49956e7e1aaec5f27b8ef9285dea353e726f997b7", "audit_sha256": "660d6a4180772e0fe242d97a53a5f2d483023850f02a85de1df32bbca3dc99f6" }, { "name": "confirmation-w774101-i775102-early_ce", "complete_sha256": "03b54e0cd2a23a1201d0e13a039c8a29ce935185ab5dbde8d99abbbffea44d16", "audit_sha256": "ac992d91748cbc93ff21000bd625906b468342c0393e6ce00679e14f7dd77157" }, { "name": "confirmation-w774101-i775102-early_ce_align", "complete_sha256": "68021223250a0473fce5a54d72f07f0a7705557e30b20fe78e3a91c87c93ff59", "audit_sha256": "1360a19b124ba976c4943e0f4d03839f33b9f8535dbe87cf9a74ad311a8d4b7e" }, { "name": "confirmation-w774102-i775101-final_ce", "complete_sha256": "d069f46c42d82b333d257555c687c904ede19709c54e9fbe21eb9dc0f1ee6f47", "audit_sha256": "76c6a4ff8d273dfd204211ea8cacb2a5e3da8f0443860a0ef8929ff59010b8a8" }, { "name": "confirmation-w774102-i775101-early_ce", "complete_sha256": "25485e203e16c49b4595e12d20f66bff32e565b2dbec927bcd8ed869be93ee58", "audit_sha256": "742d18ec0e1305ed70c3c5fab85f31394ec945f0e02ca963de4dbc13dd763f69" }, { "name": "confirmation-w774102-i775101-early_ce_align", "complete_sha256": "7b9b49ddaad3583aeec7374e6d7eca754e4b20a4847859d05c0f9e38ddad3512", "audit_sha256": "91555e185e4b2b81da871f90da397b277bc95f44265f19d42ba12ef337570da2" }, { "name": "confirmation-w774102-i775102-final_ce", "complete_sha256": "67a4dcc247e83d22f1c6d595c954b7a1db35f305f531718368e3458b33da5ace", "audit_sha256": "1975e8b9aa8d89bffa1ce282b8a962f956c1ebe407c388ea00b72720f1ea644f" }, { "name": "confirmation-w774102-i775102-early_ce", "complete_sha256": "bf1592a0b77c890f58ad66de44a05befde3e455a9b8b0c577f752d7f2bcfa7e0", "audit_sha256": "8beb0af436a2c13a7f71cc75deef07edfddf3b3a91df32e470dd11f1a6853838" }, { "name": "confirmation-w774102-i775102-early_ce_align", "complete_sha256": "baa0dff390218ce4115c9252fc13c99338b3c4d6bc4085dcfdf769761fefd7c3", "audit_sha256": "6c8ad515f08ce7a61be713cb67bb2ceea5d1ffb1a535528941d09f6428aa965f" }, { "name": "confirmation-w774103-i775101-final_ce", "complete_sha256": "c0c9f91b597817bfc6207964622fb64c5788bf4824ce509a3ea3178464d5653d", "audit_sha256": "f440563f23504aaca26bbc007a50b32f027207a2ca473ff40cdb0b7db9cff9bf" }, { "name": "confirmation-w774103-i775101-early_ce", "complete_sha256": "ea096fabbecff67074a97f1d769f569b03c5b20aaa41f185fcb25c9ef1ec4e2f", "audit_sha256": "b21570fbfb6dcda00778b1d65780670d104ac66832d25c2f9583c9cfc698cc49" }, { "name": "confirmation-w774103-i775101-early_ce_align", "complete_sha256": "f432896c3b8cad03979d2f41bd3320fd41feeb47ce7ff1a3c6b657a559ab46e1", "audit_sha256": "7d95f4cd50e9b68541dfdfdbb3e796dbd2033283ea538de54de18b7a47ecbc25" }, { "name": "confirmation-w774103-i775102-final_ce", "complete_sha256": "16f4f287b9423426950d79a6063c06257430c410c97b9ef6e9ceee08890c472d", "audit_sha256": "f39753c2d44f1b3d94a1df256d3fcb0cd54e7581a341d30e175a1f12b9b6bdbe" }, { "name": "confirmation-w774103-i775102-early_ce", "complete_sha256": "35d14cad36beabf690eaf1e1a37b0bcf56e4d83447449c8ff2d5f6db26c70bfe", "audit_sha256": "843509eac577e63689b770de07403d5b6679d9036484fa31d5c4c6c3df41c353" }, { "name": "confirmation-w774103-i775102-early_ce_align", "complete_sha256": "05d24365adeda4b08b39f17e47fcbda5920f744b61cd5c40439e9b79f353d270", "audit_sha256": "89c0085bd88fc45a088cb7a49e48ba85f4d3207f641f86ee05215a89ad3ffc1c" } ] }, { "batch": "sequential-transfer-development-v1", "registered_jobs": 8, "completed_jobs": 8, "independently_audited_jobs": 8, "cloud_verified_jobs": 8, "optimizer_updates": 96000, "sum_recorded_training_seconds": 825.2328337579966, "started_utc": "2026-10-07T04:50:05.588732+00:00", "finished_utc": "2026-10-07T04:53:08.270810+00:00", "frozen_config_sha256": "bc748bd1b36fbd3fc4c79ddf91cf038d3269ed0d5ead6c593152f676d913d99f", "controller_state_sha256": "deb09169b8b5b497ab696d48831e62f32df23a2a88b48f07ca42ac0b0f5ac471", "cloud_audit_sha256": "b60952350c001d8a46fdf97292b6a72b526921d28e2d69e19253d5f588492a61", "report": "results/sequential-transfer-development-v1/report/report.md", "report_summary_sha256": "ad7ceac22301ca57db83f21d63a786fc8d30341609cc274ab2ef2ee1c3fe62e9", "runs": [ { "name": "development-i840071-sequential_composition", "complete_sha256": "90f650842a3131401bba1487dd33ffe4bb2a822027efb3b0af051bba889d9d38", "audit_sha256": "63f3ab1966c3ff0cfb92adaef9e4e40d4ae90a200b3290375f12c051b8941a3e" }, { "name": "development-i840071-sequential_atomic", "complete_sha256": "b60fefe2b1569c2f2e13e664a5b1ef57b2d9c563dccc0a5739b11b12c13e1c17", "audit_sha256": "326bbdf165620cdbf69db459d736467782a867a3e6802c9d1833e30d9647310a" }, { "name": "development-i840071-joint", "complete_sha256": "7c343be35a6708185827e2706a15aeb2ea1c78a81fb065d06edfcf26de40f32e", "audit_sha256": "419b61db03af757c981d7e63a474e8d1df1b8ccb7971c937854c71bd0929f96a" }, { "name": "development-i840071-sequential_composition_sham", "complete_sha256": "435f5abf1e12d6daeb5ae21a7a90429d38f0265e4e6a05016439c1d89eaf405b", "audit_sha256": "3e277592f97a9b3851b9245895166483a8f3f9a900d4d38c95bba7506ca0e3cd" }, { "name": "development-i840072-sequential_composition", "complete_sha256": "5090371c5e4c74021ada250077a2ab7eabd1c124b015f65550f5c9d71ee94cd1", "audit_sha256": "3cb2ac025fc7256075f4660f4c89e3f1315a80acd4e86c2ee124a15b10614e40" }, { "name": "development-i840072-sequential_atomic", "complete_sha256": "738bb2dda447618cd7f13ab248408be83c9c55b579a1b93995927c2ddfaa708a", "audit_sha256": "e6840bae5985b5b9bc879bd3884f33285fb8f41111e755d462f742e83e5bae6e" }, { "name": "development-i840072-joint", "complete_sha256": "10a55f1e285884bd41d6be0413ccd2137806cf4f45ff264ab27178e36503c3d8", "audit_sha256": "1e19d119f3e0d455ca4839c75d5afdf48d04c140b38452dc43c54e37f32d38ad" }, { "name": "development-i840072-sequential_composition_sham", "complete_sha256": "174c21281574a1bf8e3f62037cea855a8d0e3dbdf33778120f0e9f3157bdb409", "audit_sha256": "fe69b412ca7a7104d6a7b9b2131335ab3935cede2649cfd1e8f32d1d81f9e54a" } ] }, { "batch": "sequential-transfer-confirmation-v1", "registered_jobs": 24, "completed_jobs": 24, "independently_audited_jobs": 24, "cloud_verified_jobs": 24, "optimizer_updates": 480000, "sum_recorded_training_seconds": 4152.836679764092, "started_utc": "2026-10-07T04:55:28.957411+00:00", "finished_utc": "2026-10-07T05:08:52.856739+00:00", "frozen_config_sha256": "9f134a8cb995186fba539e18a4f9c94eb439c2886580f23e809d4532e7bf0f23", "controller_state_sha256": "8881bf3dab50711aac22ba8efd216e151a3602d094115c9e5fbb3a06adcae41a", "cloud_audit_sha256": "053831d1f401a68603e2e8c2959760a960cc96c46a4e7c551f1164c7ee933fed", "report": "results/sequential-transfer-confirmation-v1/report/report.md", "report_summary_sha256": "8536558f66a6ca045aa3caf5ebfc48895cb683051cc48808fe4aa7ba205a9cde", "runs": [ { "name": "split0-i840171-sequential_composition", "complete_sha256": "e1d13112192ea086795b729058722defb4ba4f57ec2d163140fd17fd00bde17a", "audit_sha256": "74af8c1d287040079b3041dfd61e64f8e41714f89df734d22d2ca07dea6987a5" }, { "name": "split0-i840171-sequential_atomic", "complete_sha256": "4ae71012abac2108c0009fb824355b8cb2e38b84aa29c2a8401b7794e20f7cae", "audit_sha256": "b6f62881634c1717fd758b4bd2d4c2811d26e1c642375569f87854e92602d0d8" }, { "name": "split0-i840171-joint", "complete_sha256": "91b652224ddff194f962b211c30c3b08ec4a0d17170bf8595eaf2746ba5d6475", "audit_sha256": "a7c30e3d3a37a0e37d1116225b54f16b51fa633a8c0ceb0d2905111fcc17efc1" }, { "name": "split0-i840171-sequential_composition_sham", "complete_sha256": "62c3a09216e5f4447b0fe4e864eb21d46ac56b1dfc4538b987df771f195b7614", "audit_sha256": "cf83b8ef1d5e16e542619519031bc6f06d3ba775e71ffc9a5cdb51fd1b45ab42" }, { "name": "split0-i840172-sequential_composition", "complete_sha256": "1a0e8a08524c4edd417bf8ec24e37a92449cf8825f18397e4c923612e1f5ac01", "audit_sha256": "09e4284eb3619d45de5089a24c59c0b238801ba489dfd2d677d4eda77a355f96" }, { "name": "split0-i840172-sequential_atomic", "complete_sha256": "1182126f0f1504ba88c7c169c07f3cad9336606ff14d9115101fa1ee34dc8fe8", "audit_sha256": "26ca4aa1a5c747b39da33a2cba80948cc6812860698fec3fa9913634360e1e4f" }, { "name": "split0-i840172-joint", "complete_sha256": "ca1f0f475207e8afa32ea8f254975380e2e530fec1d4154b5bf1525bd8c46039", "audit_sha256": "c171de72e104a3d6367350994e79685e1b28d03bcc4ff84cd0c005fbe7f0cc17" }, { "name": "split0-i840172-sequential_composition_sham", "complete_sha256": "d9eca3031e241dc81bbac5cd88ed5d5e85e2b5ddd985a0276dce11780a8c497f", "audit_sha256": "e918157d751aeb6a1502d6850eab8764a11ef554533219e4583c9a9ca87d2c56" }, { "name": "split1-i840171-sequential_composition", "complete_sha256": "4a5cff008e2f45aa9a5038f063bc001ede951bec6c870f7cc9a1a9c4eb88f76c", "audit_sha256": "e032a99a0f05fde3d868861a5c95d947ef977bbc24e92cfd5014cef2253f7be1" }, { "name": "split1-i840171-sequential_atomic", "complete_sha256": "20ff7da9ef164516d1cbb6c8689f923d23fc0319ae8391563c7c165ad1fb4b6e", "audit_sha256": "5d6e47792cb6ae20243a89e6d9cafdfd4b43c3bdb5ce3197f514a9d71023d43d" }, { "name": "split1-i840171-joint", "complete_sha256": "9d5c96bbdb16d17fb486e95126b21f60f662847430c2db149c91e219219114d9", "audit_sha256": "3f63b44980dc4d9428fb18545e3a15e44c53223138716cecfa7d46f9cf8d8aa1" }, { "name": "split1-i840171-sequential_composition_sham", "complete_sha256": "f388f7644cb30950b243ff70c6441fb0bf0bd1b4d7a0028a9976321c397274b4", "audit_sha256": "0ddcbb8273764b301624cb3bb8d67281835ca8296576148ce4c48aca57bb36d4" }, { "name": "split1-i840172-sequential_composition", "complete_sha256": "e14578507e014963db39b4c7fa6036f4a9e3ef66519ab3c1e72ffe04fb99ab45", "audit_sha256": "6b9304b478df09426235a9a0a0832126ad4e51b1c501a219e1e3e6bd55c8facb" }, { "name": "split1-i840172-sequential_atomic", "complete_sha256": "699196103659a3eae12cc8b5e4442f7d79592abc4e64af663d345581f6f75aa5", "audit_sha256": "bc6b88dec527e9b526fa475da5e7d1687847a7db52ce46bf3128ba4625073f3d" }, { "name": "split1-i840172-joint", "complete_sha256": "b725eb2014d2f445cac781b024802f76c693e0ade48cb11f1185885640271673", "audit_sha256": "865184048812eba7ca0e803f9e99b2d777e8a54d962a4040d919a5d7b3ce7824" }, { "name": "split1-i840172-sequential_composition_sham", "complete_sha256": "a4b643ee3071a4555ef5c1404ba788c605ee8bf5b861044dd1036e596a865dda", "audit_sha256": "6c9396aca43495b0f4d092b674ddd64daef4c13b654d081015419d7b523aeb08" }, { "name": "split2-i840171-sequential_composition", "complete_sha256": "ad350fa5a3a5899e227732e43c89202f3d1b8c98152d77a5c42924ef40b3a1f7", "audit_sha256": "ec04bc75538335bbe56e1de8f8358c773c45b75e3b40a46b885a05fd20896d23" }, { "name": "split2-i840171-sequential_atomic", "complete_sha256": "f7544e4744dfbfdf064218a3febd44be4ab81091f5103efed1ca1a77cdce7cf6", "audit_sha256": "0ec04dfd3ddef64db7f33f59219b2638a05de9dfc0f06eaed211981d0d5f3a2f" }, { "name": "split2-i840171-joint", "complete_sha256": "257c4a6b57cc9c8af0e0045607210a7779274796a3a253019cb3f1376586e790", "audit_sha256": "82b95e4ac7224e6a40ea770e7bab74dc98e72cba67f4b3544a0748efe472841c" }, { "name": "split2-i840171-sequential_composition_sham", "complete_sha256": "9b6709a425a6b2bb487f34d8f7ce3f10ccd58328e6a2bb8ee1d0047b0aed3476", "audit_sha256": "de41c29055da4d7a0dd3791744b04fb9800ee9f7d8dbef3567339809a6634056" }, { "name": "split2-i840172-sequential_composition", "complete_sha256": "b219b89e7e6071e617b8fffcb05b4a73e04896f03c354bfb75946de351c2cc40", "audit_sha256": "b6dff0ba452be035caf674066330857fcbf5f2f1eaee7f2477f3440ffb04e236" }, { "name": "split2-i840172-sequential_atomic", "complete_sha256": "9edac55b6e87bdd9cfdbe840306a0e2e0590c8d157bd6846a0e7a8db8f8eee10", "audit_sha256": "cdef40deb83873d8656d2b6ef44cc5931db153e7b5d246158a2c0bcb24a6576f" }, { "name": "split2-i840172-joint", "complete_sha256": "7595750648abe567904e92abeb71d40501649f7c3fb6f1e8a4448d3366c4a792", "audit_sha256": "743d4d460c84980910db7c4802706977ac9f5aa1aabc110be42341b78ef9a949" }, { "name": "split2-i840172-sequential_composition_sham", "complete_sha256": "39cb6d8f3feaa2b25e68ddcb48c3ca60d37e9338eeaa4c538573dade2cb05745", "audit_sha256": "122fcc8c4baa49b76eb8c2824f6d382dd85e0995f6058deda03c71d8ae616228" } ] } ], "total_scientific_jobs": 53, "total_optimizer_updates": 655872, "all_independently_reloaded": true, "all_live_cloud_verified": true, "gpu_ids_used": [ 0, 1, 2, 3, 4, 5, 6, 7 ], "docker_context": "lm-memory", "image_id": "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "wandb_project": "https://wandb.ai/zhusq20/llm-memory-editability", "analysis_units": "Editing: three existing worlds, two initializations; sequential: three splits of one real graph, two initializations. Jobs, repeated queries and seeds are not independent worlds. Development results are separate.", "followup_experiments_started": false}123456789101112131415161718192021222324252627282930313233{"waiting_for_local_completion": true, "completed_runs": 16, "controller_state": "running", "tracking_passed": null}{"waiting_for_local_completion": true, "completed_runs": 16, "controller_state": "running", "tracking_passed": null}{"waiting_for_local_completion": true, "completed_runs": 18, "controller_state": "running", "tracking_passed": null}{"waiting_for_local_completion": true, "completed_runs": 24, "controller_state": "complete", "tracking_passed": null}{"waiting_for_local_completion": true, "completed_runs": 24, "controller_state": "complete", "tracking_passed": null}{"waiting_for_local_completion": false, "completed_runs": 24, "controller_state": "complete", "tracking_passed": true}wandb: [wandb.Api()] Loaded credentials for https://api.wandb.ai from /root/.netrc.wandb: [wandb.Api()] Loaded credentials for https://api.wandb.ai from /root/.netrc.{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840171-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840171-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840171-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840171-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840172-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840172-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840172-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split0-i840172-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840171-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840171-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840171-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840171-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840172-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840172-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840172-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split1-i840172-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840171-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840171-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840171-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840171-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840172-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840172-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840172-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "run": "split2-i840172-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-confirmation-v1", "passed": true, "passed_runs": 24, "checked_runs": 24}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151"""Read-only W&B endpoint audit against each completed batch's frozen run list."""
import concurrent.futuresimport hashlibimport jsonimport timefrom datetime import datetime, timezonefrom pathlib import Path
import wandb
PROJECT = Path('/ossfs/workspace/llm-memory-editability')BATCHES = {'sequential-transfer-confirmation-v1': 24}
def read(path): return json.loads(path.read_text())
def now(): return datetime.now(timezone.utc).isoformat()
def digest(path): return hashlib.sha256(path.read_bytes()).hexdigest()
def inspect_run(task): batch, name = task root = PROJECT / 'results' / batch directory = root / 'runs' / name tracking_state = root / 'tracking-wandb' / name / 'state.json' result = {'run': name, 'batch': batch, 'checked_utc': now(), 'discrepancies': []} try: state = read(tracking_state) history = read(directory / 'learning.json') manifest = read(directory / 'run.json') audited = read(directory / 'audit.json').get('passed') is True complete = (directory / 'complete.json').exists() expected = max(row['step'] for row in history) evaluation_index = manifest.get('learning_step_unit') == 'evaluation_index' run_id = state.get('wandb_run_id', state['run_id']) api = wandb.Api(timeout=45) remote = api.run(f'zhusq20/llm-memory-editability/{run_id}') last = remote.lastHistoryStep summary = dict(remote.summary) final_rows = list(remote.scan_history( min_step=expected, max_step=expected + 1, use_cache=False, keys=['_step', 'training/step'], page_size=10, )) if evaluation_index: index_rows = list(remote.scan_history( min_step=expected, max_step=expected + 1, use_cache=False, keys=['_step', 'evaluation/index'], page_size=10, )) else: index_rows = [] result.update({ 'wandb_run_id': run_id, 'url': state.get('url'), 'expected_final_step': expected, 'step_unit': 'evaluation_index' if evaluation_index else 'optimizer_update', 'local_last_logged_step': state.get('last_logged_step'), 'local_independently_reloaded': audited, 'local_complete': complete, 'remote_state': remote.state, 'remote_lastHistoryStep': last, 'remote_name': remote.name, 'remote_summary': {key: summary.get(key) for key in ( 'scientific_final_step', 'independently_reloaded', 'training/step', 'evaluation/index', 'training_state', 'has_failure_record')}, 'remote_final_history': final_rows, 'remote_evaluation_index_history': index_rows, 'input_sha256': {str(path.relative_to(root)): digest(path) for path in ( tracking_state, directory / 'run.json', directory / 'audit.json', directory / 'learning.json', directory / 'complete.json')}, }) checks = { 'local_expected_20000_updates': expected == 20000, 'remote_run_name_matches_frozen_spec': remote.name == name, 'local_scientific_complete_and_audited': complete and audited, 'local_cursor_equals_final_step': state.get('last_logged_step') == expected, 'remote_finished': remote.state == 'finished', 'remote_lastHistoryStep_equals_final_step': last == expected, 'remote_summary_scientific_final_step': summary.get('scientific_final_step') == expected, 'remote_summary_independently_reloaded': summary.get('independently_reloaded') is True, 'remote_summary_training_step': summary.get('training/step') == expected, 'remote_final_history_training_step': len(final_rows) == 1 and final_rows[0].get('training/step') == expected and final_rows[0].get('_step') == expected, 'remote_no_failure_record': summary.get('has_failure_record') is False, } if evaluation_index: checks['remote_final_evaluation_index'] = len(index_rows) == 1 and index_rows[0].get('evaluation/index') == expected checks['remote_summary_evaluation_index'] = summary.get('evaluation/index') == expected result['checks'] = checks result['discrepancies'] = [key for key, passed in checks.items() if not passed] except Exception as error: # Do not expose credentials through exception or SDK object formatting. result['discrepancies'].append('cloud_or_local_read_failed:' + type(error).__name__) result['passed'] = not result['discrepancies'] return result
if __name__ == '__main__': root = PROJECT / 'results' / 'sequential-transfer-confirmation-v1' while True: controller = read(root / 'controller-state.json') tracking_path = root / 'tracking-completion.json' tracking = read(tracking_path) if tracking_path.exists() else {} ready = (controller.get('state') == 'complete' and len(controller.get('completed', [])) == 24 and tracking.get('passed') is True and tracking.get('registered_runs') == 24) print(json.dumps({'waiting_for_local_completion': not ready, 'completed_runs': len(controller.get('completed', [])), 'controller_state': controller.get('state'), 'tracking_passed': tracking.get('passed')}), flush=True) if ready: break if controller.get('failed') or controller.get('state') == 'finished_with_failures': raise RuntimeError('Local scientific controller failed; preserve state for review') time.sleep(15) started = time.monotonic() configs = {batch: read(PROJECT / 'results' / batch / 'frozen-config.json') for batch in BATCHES} tasks = [(batch, spec['name']) for batch, config in configs.items() for spec in config['specs']] results = {batch: [] for batch in BATCHES} with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool: for result in pool.map(inspect_run, tasks): results[result['batch']].append(result) print(json.dumps({'batch': result['batch'], 'run': result['run'], 'passed': result['passed'], 'discrepancies': result['discrepancies']}), flush=True) for batch, records in results.items(): root = PROJECT / 'results' / batch expected = {spec['name'] for spec in configs[batch]['specs']} states = {path.parent.name for path in (root / 'tracking-wandb').glob('*/state.json')} discrepancies = [] if len(expected) != BATCHES[batch]: discrepancies.append('frozen_run_count_not_expected') if expected != states: discrepancies.append('tracking_state_run_matrix_mismatch') artifact = { 'passed': not discrepancies and all(row['passed'] for row in records), 'batch': batch, 'checked_utc': now(), 'audit_kind': 'read_only_live_wandb_API', 'sdk_version': wandb.__version__, 'expected_runs': BATCHES[batch], 'checked_runs': len(records), 'passed_runs': sum(row['passed'] for row in records), 'discrepancies': discrepancies, 'missing_tracking_states': sorted(expected - states), 'unexpected_tracking_states': sorted(states - expected), 'runs': records, 'source_sha256': digest(Path(__file__)), 'frozen_config_sha256': digest(root / 'frozen-config.json'), 'seconds_all_batches': time.monotonic() - started, } output = root / 'tracking-cloud-audit.json' if output.exists(): raise FileExistsError(f'Preserve prior audit before running again: {output}') output.write_text(json.dumps(artifact, indent=2) + '\n') print(json.dumps({'batch': batch, 'passed': artifact['passed'], 'passed_runs': artifact['passed_runs'], 'checked_runs': len(records)}), flush=True)12345678910111213141516171819202122232425262728293031323334wandb: [wandb.Api()] Loaded credentials for https://api.wandb.ai from /root/.netrc.wandb: [wandb.Api()] Loaded credentials for https://api.wandb.ai from /root/.netrc.{"batch": "write-target-development-v1", "run": "development-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-development-v1", "run": "development-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-development-v1", "run": "development-early_ce_align", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774101-i775101-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774101-i775101-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774101-i775101-early_ce_align", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774101-i775102-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774101-i775102-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774101-i775102-early_ce_align", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774102-i775101-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774102-i775101-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774102-i775101-early_ce_align", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774102-i775102-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774102-i775102-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774102-i775102-early_ce_align", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774103-i775101-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774103-i775101-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774103-i775101-early_ce_align", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774103-i775102-final_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774103-i775102-early_ce", "passed": true, "discrepancies": []}{"batch": "write-target-confirmation-v1", "run": "confirmation-w774103-i775102-early_ce_align", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840071-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840071-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840071-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840071-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840072-sequential_composition", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840072-sequential_atomic", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840072-joint", "passed": true, "discrepancies": []}{"batch": "sequential-transfer-development-v1", "run": "development-i840072-sequential_composition_sham", "passed": true, "discrepancies": []}{"batch": "write-target-development-v1", "passed": true, "passed_runs": 3, "checked_runs": 3}{"batch": "write-target-confirmation-v1", "passed": true, "passed_runs": 18, "checked_runs": 18}{"batch": "sequential-transfer-development-v1", "passed": true, "passed_runs": 8, "checked_runs": 8}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135"""Read-only W&B endpoint audit against each completed batch's frozen run list."""
import concurrent.futuresimport hashlibimport jsonimport timefrom datetime import datetime, timezonefrom pathlib import Path
import wandb
PROJECT = Path('/ossfs/workspace/llm-memory-editability')BATCHES = { 'write-target-development-v1': 3, 'write-target-confirmation-v1': 18, 'sequential-transfer-development-v1': 8,}
def read(path): return json.loads(path.read_text())
def now(): return datetime.now(timezone.utc).isoformat()
def digest(path): return hashlib.sha256(path.read_bytes()).hexdigest()
def inspect_run(task): batch, name = task root = PROJECT / 'results' / batch directory = root / 'runs' / name tracking_state = root / 'tracking-wandb' / name / 'state.json' result = {'run': name, 'batch': batch, 'checked_utc': now(), 'discrepancies': []} try: state = read(tracking_state) history = read(directory / 'learning.json') manifest = read(directory / 'run.json') audited = read(directory / 'audit.json').get('passed') is True complete = (directory / 'complete.json').exists() expected = max(row['step'] for row in history) evaluation_index = manifest.get('learning_step_unit') == 'evaluation_index' run_id = state.get('wandb_run_id', state['run_id']) api = wandb.Api(timeout=45) remote = api.run(f'zhusq20/llm-memory-editability/{run_id}') last = remote.lastHistoryStep summary = dict(remote.summary) final_rows = list(remote.scan_history( min_step=expected, max_step=expected + 1, use_cache=False, keys=['_step', 'training/step'], page_size=10, )) if evaluation_index: index_rows = list(remote.scan_history( min_step=expected, max_step=expected + 1, use_cache=False, keys=['_step', 'evaluation/index'], page_size=10, )) else: index_rows = [] result.update({ 'wandb_run_id': run_id, 'url': state.get('url'), 'expected_final_step': expected, 'step_unit': 'evaluation_index' if evaluation_index else 'optimizer_update', 'local_last_logged_step': state.get('last_logged_step'), 'local_independently_reloaded': audited, 'local_complete': complete, 'remote_state': remote.state, 'remote_lastHistoryStep': last, 'remote_summary': {key: summary.get(key) for key in ( 'scientific_final_step', 'independently_reloaded', 'training/step', 'evaluation/index', 'training_state', 'has_failure_record')}, 'remote_final_history': final_rows, 'remote_evaluation_index_history': index_rows, 'input_sha256': {str(path.relative_to(root)): digest(path) for path in ( tracking_state, directory / 'run.json', directory / 'audit.json', directory / 'learning.json', directory / 'complete.json')}, }) checks = { 'local_scientific_complete_and_audited': complete and audited, 'local_cursor_equals_final_step': state.get('last_logged_step') == expected, 'remote_finished': remote.state == 'finished', 'remote_lastHistoryStep_equals_final_step': last == expected, 'remote_summary_scientific_final_step': summary.get('scientific_final_step') == expected, 'remote_summary_independently_reloaded': summary.get('independently_reloaded') is True, 'remote_summary_training_step': summary.get('training/step') == expected, 'remote_final_history_training_step': len(final_rows) == 1 and final_rows[0].get('training/step') == expected and final_rows[0].get('_step') == expected, 'remote_no_failure_record': summary.get('has_failure_record') is False, } if evaluation_index: checks['remote_final_evaluation_index'] = len(index_rows) == 1 and index_rows[0].get('evaluation/index') == expected checks['remote_summary_evaluation_index'] = summary.get('evaluation/index') == expected result['checks'] = checks result['discrepancies'] = [key for key, passed in checks.items() if not passed] except Exception as error: # Do not expose credentials through exception or SDK object formatting. result['discrepancies'].append('cloud_or_local_read_failed:' + type(error).__name__) result['passed'] = not result['discrepancies'] return result
if __name__ == '__main__': started = time.monotonic() configs = {batch: read(PROJECT / 'results' / batch / 'frozen-config.json') for batch in BATCHES} tasks = [(batch, spec['name']) for batch, config in configs.items() for spec in config['specs']] results = {batch: [] for batch in BATCHES} with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool: for result in pool.map(inspect_run, tasks): results[result['batch']].append(result) print(json.dumps({'batch': result['batch'], 'run': result['run'], 'passed': result['passed'], 'discrepancies': result['discrepancies']}), flush=True) for batch, records in results.items(): root = PROJECT / 'results' / batch expected = {spec['name'] for spec in configs[batch]['specs']} states = {path.parent.name for path in (root / 'tracking-wandb').glob('*/state.json')} discrepancies = [] if len(expected) != BATCHES[batch]: discrepancies.append('frozen_run_count_not_expected') if expected != states: discrepancies.append('tracking_state_run_matrix_mismatch') artifact = { 'passed': not discrepancies and all(row['passed'] for row in records), 'batch': batch, 'checked_utc': now(), 'audit_kind': 'read_only_live_wandb_API', 'sdk_version': wandb.__version__, 'expected_runs': BATCHES[batch], 'checked_runs': len(records), 'passed_runs': sum(row['passed'] for row in records), 'discrepancies': discrepancies, 'missing_tracking_states': sorted(expected - states), 'unexpected_tracking_states': sorted(states - expected), 'runs': records, 'source_sha256': digest(Path(__file__)), 'frozen_config_sha256': digest(root / 'frozen-config.json'), 'seconds_all_batches': time.monotonic() - started, } output = root / 'tracking-cloud-audit.json' if output.exists(): raise FileExistsError(f'Preserve prior audit before running again: {output}') output.write_text(json.dumps(artifact, indent=2) + '\n') print(json.dumps({'batch': batch, 'passed': artifact['passed'], 'passed_runs': artifact['passed_runs'], 'checked_runs': len(records)}), flush=True)123456789101112131415161718192021222324252627282930313233{ "gpu": 0, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu0", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=0", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 6.0362953916192055, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 251.9317626953125}, {\"dtype\": \"torch.bfloat16\", \"loss\": 258.50152587890625}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 1, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu1", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=1", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 6.1026708744466305, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 250.42819213867188}, {\"dtype\": \"torch.bfloat16\", \"loss\": 260.62384033203125}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 2, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu2", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=2", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 6.13227254524827, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 249.24713134765625}, {\"dtype\": \"torch.bfloat16\", \"loss\": 259.512939453125}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 3, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu3", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=3", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 5.958154123276472, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 256.6463623046875}, {\"dtype\": \"torch.bfloat16\", \"loss\": 250.81063842773438}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 4, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu4", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=4", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 5.621768973767757, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 245.85626220703125}, {\"dtype\": \"torch.bfloat16\", \"loss\": 264.32830810546875}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 5, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu5", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=5", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 5.8141623586416245, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 260.80841064453125}, {\"dtype\": \"torch.bfloat16\", \"loss\": 257.79876708984375}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 6, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu6", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=6", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 5.9034763388335705, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 259.39459228515625}, {\"dtype\": \"torch.bfloat16\", \"loss\": 248.84918212890625}]}\n", "stderr": ""}123456789101112131415161718192021222324252627282930313233{ "gpu": 7, "command": [ "docker", "--context", "lm-memory", "run", "--name", "lm-learning-use-runtime-20261007-gpu7", "--label", "project=llm-memory-editability", "--label", "batch=learning-use-runtime-20261007", "--network=none", "--gpus", "device=7", "--cpus", "2", "--memory", "8g", "--read-only", "--tmpfs", "/tmp:rw,size=1g", "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "/opt/conda/bin/python", "-c", "import json,torch,transformers\ntorch.set_num_threads(1)\nassert torch.cuda.device_count()==1\nvalues=[]\nfor dtype in (torch.float32,torch.bfloat16):\n x=torch.randn(128,128,device=\"cuda\",dtype=dtype,requires_grad=True)\n loss=(x@x.T).float().square().mean()\n loss.backward()\n torch.cuda.synchronize()\n assert torch.isfinite(loss) and torch.isfinite(x.grad).all()\n values.append({\"dtype\":str(dtype),\"loss\":float(loss)})\nprint(json.dumps({\"passed\":True,\"torch\":torch.__version__,\"transformers\":transformers.__version__,\"gpu\":torch.cuda.get_device_name(0),\"computations\":values}))" ], "returncode": 0, "seconds": 5.487973179668188, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 255.28213500976562}, {\"dtype\": \"torch.bfloat16\", \"loss\": 248.97308349609375}]}\n", "stderr": ""}12345678910111213141516171819202122232425262728293031323334353637383940414243444546{ "image": "sha256:a994f1a1886220693eb26b7ff201147fbd4b49477d335ab2707330cab771063f", "checks": [ { "gpu": 0, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 251.9317626953125}, {\"dtype\": \"torch.bfloat16\", \"loss\": 258.50152587890625}]}\n" }, { "gpu": 1, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 250.42819213867188}, {\"dtype\": \"torch.bfloat16\", \"loss\": 260.62384033203125}]}\n" }, { "gpu": 2, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 249.24713134765625}, {\"dtype\": \"torch.bfloat16\", \"loss\": 259.512939453125}]}\n" }, { "gpu": 3, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 256.6463623046875}, {\"dtype\": \"torch.bfloat16\", \"loss\": 250.81063842773438}]}\n" }, { "gpu": 4, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 245.85626220703125}, {\"dtype\": \"torch.bfloat16\", \"loss\": 264.32830810546875}]}\n" }, { "gpu": 5, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 260.80841064453125}, {\"dtype\": \"torch.bfloat16\", \"loss\": 257.79876708984375}]}\n" }, { "gpu": 6, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 259.39459228515625}, {\"dtype\": \"torch.bfloat16\", \"loss\": 248.84918212890625}]}\n" }, { "gpu": 7, "returncode": 0, "stdout": "{\"passed\": true, \"torch\": \"2.6.0+cu126\", \"transformers\": \"4.40.0\", \"gpu\": \"NVIDIA L20X\", \"computations\": [{\"dtype\": \"torch.float32\", \"loss\": 255.28213500976562}, {\"dtype\": \"torch.bfloat16\", \"loss\": 248.97308349609375}]}\n" } ], "passed": true}123version https://git-lfs.github.com/spec/v1oid sha256:27db5069d4361a607f02133ab4da4d9dae601bfbff0677191b3ba7febe2f987csize 3211318123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749[[PDF PAGE 1]]Training Large Language Models to Reason in aContinuous Latent SpaceShibo Hao1,2,∗,Sainbayar Sukhbaatar 1,DiJia Su 1,Xian Li 1,Zhiting Hu 2,Jason Weston 1,Yuandong Tian 11FAIR at Meta,2UC San Diego∗Work done at MetaLarge language models (LLMs) are restricted to reason in the “language space”, where they typicallyexpress the reasoning process with a chain-of-thought (CoT) to solve a complex reasoning problem.However, we argue that language space may not always be optimal for reasoning. For example, mostword tokens primarily ensure textual coherence and are not essential for reasoning, while some criticaltokens require complex planning and pose huge challenges to LLMs. To explore the potential ofLLM reasoning in an unrestricted latent space instead of using natural language, we introduce a newparadigmCoconut( Chain of Continuous Thought). We utilize the last hidden state of the LLM as arepresentation of the reasoning state (termed “continuous thought”). Rather than decoding this into aword token, we feed it back to the LLM as the subsequent input embedding directly in the continuousspace. This latent reasoning paradigm leads to the emergence of an advanced reasoning pattern:the continuous thought can encode multiple alternative next reasoning steps, allowing the model toperform a breadth-first search (BFS) to solve the problem, rather than prematurely committing to asingle deterministic path like CoT.Coconutoutperforms CoT on certain logical reasoning tasksthat require substantial search during planning, and shows a better trade-off between accuracy andefficiency.Last updated:August 25, 2026Code:https://github.com/facebookresearch/coconut1 IntroductionLarge language models (LLMs) have demonstrated remarkable reasoning abilities, emerging from extensivepretraining on human languages (Dubey et al., 2024; Achiam et al., 2023). While next token prediction is aneffective training objective, it imposes a fundamental constraint on the LLM as a reasoning machine: theexplicit reasoning process of LLMs must be generated in word tokens. For example, a prevalent approach,known as chain-of-thought (CoT) reasoning (Wei et al., 2022), involves prompting or training LLMs togenerate solutions step-by-step using natural language. However, this is in stark contrast to certain humancognition results. Neuroimaging studies have consistently shown that the language network – a set of brainregions responsible for language comprehension and production – remains largely inactive during variousreasoning tasks (Amalric and Dehaene, 2019; Monti et al., 2012, 2007, 2009; Fedorenko et al., 2011). Furtherevidence indicates that human language is optimized for communication rather than reasoning (Fedorenkoet al., 2024).A significant issue arises when LLMs use language for reasoning: the amount of reasoning required for eachparticular token varies greatly, yet current LLM architectures allocate nearly the same computing budgetfor predicting every token. Most tokens in a reasoning chain are generated solely for fluency, contributinglittle to the actual reasoning process. By contrast, some critical tokens require complex planning and posehuge challenges to LLMs. While previous work has attempted to fix these problems by prompting LLMs togenerate succinct reasoning chains (Madaan and Yazdanbakhsh, 2022), or performing additional reasoningbefore generating some critical tokens (Zelikman et al., 2024), these solutions remain constrained within thelanguage space and do not solve the fundamental problems. On the contrary, it would be ideal for LLMs tohave the freedom to reason without any language constraints, and then translate their findings into languageonly when necessary.1arXiv:2412.06769v4 [cs.CL] 23 Aug 2026
[[PDF PAGE 2]]Figure 1A comparison of Chain of Continuous Thought (Coconut) with Chain-of-Thought (CoT). In CoT, the modelgenerates the reasoning process as a word token sequence (e.g.,[xi, xi+1, ..., xi+j]in the figure).Coconutregards thelast hidden state as a representation of the reasoning state (termed “continuous thought”), and directly uses it as thenext input embedding. This allows the LLM to reason in an unrestricted latent space instead of a language space.In this work we instead explore LLM reasoning in a latent space by introducing a novel paradigm,Coconut(Chain of Continuous Thought). It involves a simple modification to the traditional CoT process: instead ofmapping between hidden states and language tokens using the language model head and embedding layer,Coconutdirectly feeds the last hidden state (a continuous thought) as the input embedding for the nexttoken (Figure 1). This modification frees the reasoning from being within the language space, and the systemcan be optimized end-to-end by gradient descent, as continuous thoughts are fully differentiable. To enhancethe training of latent reasoning, we employ a multi-stage training strategy inspired by Deng et al. (2024),which effectively utilizes language reasoning chains to guide the training process.Interestingly, our proposed paradigm leads to an efficient reasoning pattern. Unlike language-based reasoning,continuous thoughts inCoconutcan encode multiple potential next steps simultaneously, allowing for areasoning process akin to breadth-first search (BFS). While the model may not initially make the correctdecision, it can maintain many possible options within the continuous thoughts and progressively eliminateincorrect paths through reasoning, guided by some implicit value functions. This advanced reasoningmechanism surpasses traditional CoT, even though the model is not explicitly trained or instructed to operatein this manner, as seen in previous works (Yao et al., 2023; Hao et al., 2023).Experimentally,Coconutsuccessfully enhances the reasoning capabilities of LLMs. For math reasoning(GSM8k, Cobbe et al., 2021), using continuous thoughts is shown to be beneficial to reasoning accuracy,mirroring the effects of language reasoning chains. This indicates the potential to scale and solve increasinglychallenging problems by chaining more continuous thoughts. On logical reasoning including ProntoQA (Saparovand He, 2022), and our newly proposed ProsQA (Section 4) which requires stronger planning ability,Coconutand some of its variants even surpasses language-based CoT methods, while generating significantly fewertokens during inference. We believe that these findings underscore the potential of latent reasoning and couldprovide valuable insights for future research.2 Related WorkChain-of-thought (CoT) reasoning.We use the term chain-of-thought broadly to refer to methods that generatean intermediate reasoning process in language before outputting the final answer. This includes promptingLLMs (Wei et al., 2022; Khot et al., 2022; Zhou et al., 2022), or training LLMs to generate reasoning chains,either with supervised finetuning (Yue et al., 2023; Yu et al., 2023) or reinforcement learning (Wang et al.,2024; Havrilla et al., 2024; Shao et al., 2024; Yu et al., 2024a). Madaan and Yazdanbakhsh (2022) classifiedthe tokens in CoT into symbols, patterns, and text, and proposed to guide the LLM to generate concise CoTbased on analysis of their roles. Recent theoretical analyses have demonstrated the usefulness of CoT fromthe perspective of model expressivity (Feng et al., 2023; Merrill and Sabharwal, 2023; Li et al., 2024). Byemploying CoT, the effective depth of the transformer increases because the generated outputs are loopedback to the input (Feng et al., 2023). These analyses, combined with the established effectiveness of CoT,2
[[PDF PAGE 3]]motivated our design of feeding the continuous thoughts back into the LLM as input embeddings. WhileCoT has proven effective for certain tasks, its autoregressive generation nature makes it challenging to mimichuman reasoning on more complex problems (LeCun, 2022; Hao et al., 2023), which typically require planningand search. There are works that equip LLMs with explicit tree search algorithms (Xie et al., 2023; Yao et al.,2023; Hao et al., 2024), or train the LLM on search dynamics and trajectories (Lehnert et al., 2024; Gandhiet al., 2024; Su et al., 2024). In our analysis, we find that after removing the constraint of a language space, anew reasoning pattern similar to BFS emerges, even though the model is not explicitly trained in this way.Latent reasoning in LLMs.Previous works mostly define latent reasoning in LLMs as the hidden computationin transformers (Yang et al., 2024; Biran et al., 2024). Yang et al. (2024) constructed a dataset of two-hopreasoning problems and discovered that it is possible to recover the intermediate variable from the hiddenrepresentations. Biran et al. (2024) further proposed to intervene the latent reasoning by “back-patching” thehidden representation. Shalev et al. (2024) discovered parallel latent reasoning paths in LLMs. Another lineof work has discovered that, even if the model generates a CoT to reason, the model may actually utilize adifferent latent reasoning process. This phenomenon is known as the unfaithfulness of CoT reasoning (Wanget al., 2022; Turpin et al., 2024). To enhance the latent reasoning of LLMs, previous research proposed toaugment it with additional tokens. Goyal et al. (2023) pretrained the model by randomly inserting a learnable<pause> tokens to the training corpus. This improves LLM’s performance on a variety of tasks, especiallywhen followed by supervised finetuning with<pause> tokens. On the other hand, Pfau et al. (2024) furtherexplored the usage of filler tokens, e.g., “...”, and concluded that they work well for highly parallelizableproblems. However, Pfau et al. (2024) mentioned these methods do not extend the expressivity of the LLM likeCoT; hence, they may not scale to more general and complex reasoning problems. Wang et al. (2023) proposedto predict a planning token as a discrete latent variable before generating the next reasoning step. Recently,it has also been found that one can “internalize” the CoT reasoning into latent reasoning in the transformerwith knowledge distillation (Deng et al., 2023) or a special training curriculum which gradually shortensCoT (Deng et al., 2024). Yu et al. (2024b) also proposed to distill a model that can reason latently from datagenerated with complex reasoning algorithms. These training methods can be combined to our framework,and specifically, we find that breaking down the learning of continuous thoughts into multiple stages, inspiredby iCoT (Deng et al., 2024), is very beneficial for the training. Other work explores alternative architecturesfor latent reasoning, including looped transformers (Giannou et al., 2023; Fan et al., 2024), diffusion models insentence embedding space (Barrault et al., 2024). Recurrent memory transformers similarly pass informationacross segments through continuous memory embeddings updated at each recurrent step rather than throughlanguage tokens (Bulatov et al., 2022), with associative memory mechanisms later introduced to scale thisrecurrence to longer contexts (Rodkin et al., 2024). Different from these works, we focus on general multi-stepreasoning tasks and aim to investigate the unique properties of latent reasoning in comparison to languagespace. In addition to reasoning tasks, Pham et al. (2023) also explored using continuous space for multi-agentcommunication. Building onCoconut, Zhu et al. (2025b) developed a theoretical framework demonstratingthat continuous CoT can be more efficient than discrete CoT on certain tasks by encoding multiple reasoningpaths in superposition states. Subsequently, Zhu et al. (2025a) analyzed the training dynamics to explain howsuch superposition emerges under theCoconuttraining objective.3 Coconut: Chain of Continuous ThoughtIn this section, we introduce our new paradigmCoconut(Chain of Continuous Thought) for reasoning inan unconstrained latent space. We begin by introducing the background and notation we use for languagemodels. For an input sequencex= (x 1, ..., xT ), the standard large language modelMcan be described as:Ht =Transformer(E t)M(xt+1|x ≤t) =softmax(W h t)where Et = [ e(x1), e(x2), ..., e(xt)]is the sequence of token embeddings up to positiont; Ht∈R t×d is thematrix of the last hidden states for all tokens up to positiont; ht is the last hidden state of positiont, i.e.,ht =H t[t,:];e(·)is the token embedding function;Wis the parameter of the language model head.3
[[PDF PAGE 4]]Figure 2Training procedure of Chain of Continuous Thought (Coconut). Given training data with language reasoningsteps, at each training stage we integratec additional continuous thoughts (c = 1in this example), and remove onelanguage reasoning step. The cross-entropy loss is then used on the remaining tokens after continuous thoughts.Method Overview.In the proposedCoconutmethod, the LLM switches between the “language mode” and“latent mode” (Figure 1). In language mode, the model operates as a standard language model, autoregressivelygenerating the next token. In latent mode, it directly utilizes the last hidden state as the next input embedding.This last hidden state represents the current reasoning state, termed as a “continuous thought”.Special tokens <bot> and <eot> are employed to mark the beginning and end of the latent thoughtmode, respectively. As an example, we assume latent reasoning occurs between positionsi and j, i.e., xi =<bot> and xj = <eot>. When the model is in the latent mode (i < t < j ), we use the last hidden statefrom the previous token to replace the input embedding, i.e.,Et = [ e(x1), e(x2), ..., e(xi), hi, hi+1, ..., ht−1].After the latent mode finishes ( t≥j ), the input reverts to using the token embedding, i.e., Et =[e(x1), e(x2), ..., e(xi), hi, hi+1, ..., hj−1, e(xj), ..., e(xt)]. It is worth noting that the last hidden states havebeen processed by the final normalization layer, so they are not too large in magnitude.M(xt+1|x ≤t)isnot defined wheni < t < j , since the latent thought is not intended to be mapped back to language space.However,softmax(W h t)can still be calculated for probing purposes (see Section 5).Training Procedure.In this work, we focus on a problem-solving setting where the model receives a question asinput and is expected to generate an answer through a reasoning process. We leverage language CoT datato supervise continuous thought by implementing a multi-stage training curriculum inspired by Deng et al.(2024). As shown in Figure 2, in the initial stage, the model is trained on regular CoT instances. In thesubsequent stages, at thek-th stage, the firstk reasoning steps in the CoT are replaced withk×c continuousthoughts1, where c is a hyperparameter controlling the number of latent thoughts replacing a single languagereasoning step. Following Deng et al. (2024), we also reset the optimizer state when training stages switch. Weinsert <bot> and <eot> tokens (which are not counted towardsc) to encapsulate the continuous thoughts.During the training process, we optimize the normal negative log-likelihood loss, but mask the loss on questionsand latent thoughts. It is important to note that the objective doesnotencourage the continuous thought tocompress the removed language thought, but rather tofacilitate the prediction of future reasoning. Therefore,it’s possible for the LLM to learn more effective representations of reasoning steps compared to humanlanguage.Training Details.Our proposed continuous thoughts are fully differentiable and allow for back-propagation. Weperform n + 1forward passes when n latent thoughts are scheduled in the current training stage, computinga new latent thought with each pass and finally conducting an additional forward pass to obtain a loss1If a language reasoning chain is shorter thanksteps, then all the language thoughts will be removed.4
[[PDF PAGE 5]]on the remaining text sequence. While we can save any repetitive computing by using a KV cache, thesequential nature of the multiple forward passes poses challenges for parallelism. Further optimizing thetraining efficiency ofCoconutremains an important direction for future research.Inference Process.The inference process forCoconutis analogous to standard language model decoding,except that in latent mode, we directly feed the last hidden state as the next input embedding. A challengelies in determining when to switch between latent and language modes. As we focus on the problem-solvingsetting, we insert a<bot> token immediately following the question tokens. For<eot>, we consider twopotential strategies: a) train a binary classifier on latent thoughts to enable the model to autonomouslydecide when to terminate the latent reasoning, or b) always pad the latent thoughts to a constant length. Wefound that both approaches work comparably well. Therefore, we use the second option in our experiment forsimplicity, unless specified otherwise.4 Continuous Space Enables Latent Tree SearchIn this section, we provide a proof of concept of the advantage of continuous latent space reasoning. OnProsQA, a new dataset that requires extensive planning ability,Coconutoutperforms language space CoTreasoning. Interestingly, our analysis indicates that the continuous representation of reasoning can encodemultiple alternative next reasoning steps. This allows the model to perform a breadth-first search (BFS) tosolve the problem, instead of prematurely committing to a single deterministic path like language CoT.We start by introducing the experimental setup (Section 4.1). By leveragingCoconut’s ability to switchbetween language and latent space reasoning, we are able to control the model to interpolate between fullylatent reasoning and fully language reasoning and test their performance (Section 4.2). This also enables usto interpret the latent reasoning process as tree search (Section 4.3). Based on this perspective, we explainwhy latent reasoning can help LLMs make better decisions (Section 4.4).4.1 Experimental SetupDataset.We introduce ProsQA (Proof withSearch Question-Answering), a new logical reasoning dataset.A visualized example is shown in Figure 4. Each instance in ProsQA consists of a directed acyclic graph(DAG) of logical relationships between concepts, presented as natural language statements. The task requiresmodels to determine logical relationships by finding valid paths through this graph, demanding sophisticatedplanning and search strategies. Unlike previous logical reasoning datasets like ProntoQA (Saparov and He,2022), ProsQA’s DAG structure introduces complex exploration paths, making it particularly challenging formodels to identify the correct reasoning chain. More comprehensive details about the dataset constructionand characteristics can be found in Appendix A.Setup.We use a pre-trained GPT-2 model as the base model for all experiments. The learning rate is set to1× 10−4 while the effective batch size is 128. We train aCoconutmodel following the training procedure inSection 3. Since the maximum reasoning steps in ProsQA is 6, we set the number of training stages toN = 6in the training procedure. In each stage, we train the model for 5 epochs, and stay in the last stage until the50 epochs. The checkpoint with the best accuracy in the last stage is used for evaluation. As reference, wereport the performance of (1)CoT: the model is trained with CoT data, and during inference, the model willgenerate a complete reasoning chain to solve the problem. (2)no-CoT: the model is trained with only thequestion and answer pairs, without any reasoning steps. During inference, the model will output the finalanswer directly.To understand the properties of latent and language reasoning space,we manipulate the model to switchbetween fully latent reasoning and fully language reasoning, by manually setting the position of the<eot>token during inference. When we enforceCoconutto use k continuous thoughts, the model is expectedto output the remaining reasoning chain in language, starting from thek + 1step. In our experiments, wetest variants ofCoconuton ProsQA with k∈{ 0, 1, 2, 3, 4, 5, 6}. Note that all these variants only differ ininference time while sharing the same model weights.Metrics.We apply two sets of evaluation metrics. One of them is based on the correctness of thefinal answer,regardless of the reasoning process. It is also the main metric used in the later sections (Section 5.3). To5
[[PDF PAGE 6]]Figure 3The accuracy of final answer (left) and reasoning process (right) of multiple variants ofCoconutand baselineson ProsQA.enable fine-grained analysis on ProsQA, we define another metric on thereasoning process. We classify areasoning chain into (1)Correct Path: The output is one of the shortest paths to the correct answer. (2)Longer Path: A valid path that correctly answers the question but is longer than the shortest path. (3)Hallucination: The path includes nonexistent edges or is disconnected. (4)Wrong Target: A valid path in thegraph, but the destination node is not the one being asked. These four categories naturally apply to theoutput fromCoconut( k = 0) andCoT, which generate the full path. ForCoconutwithk > 0that outputsonly partial paths in language (with the initial steps in continuous reasoning), we classify the reasoning asa Correct Pathif a valid explanation can complete it. Also, we define Longer Path and Wrong Target forpartial paths similarly. If no valid explanation completes the path, it’s classified as Hallucination. Inno-CoTandCoconutwith larger k, the model may only output the final answer without any partial path, and itfalls into (5)Correct Labelor (6)Incorrect Label. These six categories cover all cases without overlap.4.2 Overall ResultsFigure 3 presents a comparative analysis of various reasoning methods evaluated on ProsQA. The modeltrained usingCoTfrequently hallucinates non-existent edges or outputs paths leading to incorrect targets,resulting in lower answer accuracy. In contrast,Coconut, which leverages continuous space reasoning,demonstrates improved accuracy as it utilizes an increasing number of continuous thoughts. Additionally, therate of correct reasoning processes (indicated by “Correct Label” and “Correct Path”) significantly increases.At the same time, there is a notable reduction in instances of “Hallucination” and “Wrong Target,” issues thattypically emerge when the model makes mistakes early in the reasoning process.An intuitive demonstration of the limitations of reasoning in language space is provided by the case studydepicted in Figure 4. As shown, models operating in language space often fail to plan ahead or backtrack.Once they commit to an incorrect path, they either hallucinate unsupported edges or terminate with irrelevantconclusions. In contrast, latent reasoning avoids such premature commitments by enabling the model toiteratively refine its decisions across multiple reasoning steps. This flexibility allows the model to progressivelyeliminate incorrect options and converge on the correct answer, ultimately resulting in higher accuracy.4.3 Interpreting the Latent Reasoning as Tree SearchTo better understandCoconut, we probe the latent reasoning process by forcing the model to explicitlygenerate language reasoning steps following intermediate continuous thoughts (Figure 5). Using the examplepresented in Figure 4, at the initial reasoning step, the model must select which immediate child node of“Alex” to consider next, specifically from the set {“lempus”, “sterpus”, “zhorpus”, “grimpus”}. The distributionover these candidate next steps is visualized in Figure 5, left. In the subsequent reasoning step, these nodes6
[[PDF PAGE 7]]expand further into an extended set of potential paths, including all grandchildren of “Alex” (Figure 5, right).Figure 4A case study of ProsQA. The model trained withCoThallucinates an edge (Every yumpus is a rempus) aftergetting stuck in a dead end.Coconut(k=1) outputs a path that ends with an irrelevant node.Coconut(k=2)solves the problem correctly.Figure 5An illustration of the latent search trees. The example is the same test case as in Figure 4. The height ofa node (denoted ash in the figure) is defined as the longest distance to any leaf nodes in the graph. We show theprobability of the first concept predicted by the model following latent thoughts (e.g., “lempus” in the left figure). It iscalculated as the multiplication of the probability of all tokens within the concept conditioned on previous context(omitted in the figure for brevity). This metric can be interpreted as an implicit value function estimated by the model,assessing the potential of each node leading to the correct answer.We define the predicted probability of a concept following continuous thoughts as a value function (Figure 5),estimating each node’s potential for reaching the correct target. Interestingly, the reasoning strategy employedbyCoconutis not greedy search: while “lempus” initially has the highest value (0.33) at the first reasoningstep (Figure 5, left), the model subsequently assigns the highest value (0.87) to “rorpus,” a child of “grimpus,”rather than following “lempus” (Figure 5, right). This characteristic resembles a breadth-first search (BFS)approach, contrasting sharply with the greedy decoding typical of traditional CoT methods. The inherentcapability of continuous representations to encode multiple candidate paths enables the model to avoid makingimmediate deterministic decisions. Importantly, this tree search pattern is not limited to the illustratedexample, but constitutes a fundamental mechanism underlying the consistent improvement observed withlarger values ofkinCoconut.Figure 6 presents an analysis of the parallelism in the model’s latent reasoning across the first and secondthoughts. For the first thoughts (left panel), the cumulative values of the top-1, top-2, and top-3 candidate7
[[PDF PAGE 8]]Figure 6Analysis of parallelism in the first two steps of the latent tree search. The three curves in each panel depictthe cumulative value of the top-1, top-2, and top-3 candidate nodes.nodes are computed and plotted against their respective percentiles across the test set. The noticeable gapsbetween the three lines indicate that the model maintains significant diversity in its reasoning paths at thisstage, suggesting a broad exploration of alternative possibilities. In contrast, the second thoughts (right panel)show a narrowing of these gaps. This trend suggests that the model transitions from parallel exploration tomore focused reasoning in the second latent reasoning step, likely as it gains more certainty about the mostpromising paths.4.4 Why is Latent Space Better for Planning?Building upon the tree search perspective, we further examine why latent reasoning benefits planningtasks—specifically, why maintaining multiple candidate paths and postponing deterministic decisions enhancesreasoning performance. Our hypothesis is that nodes explored in the early reasoning stages are inherentlymore challenging to evaluate accurately because they are farther from the final target nodes. In contrast,nodes positioned closer to potential targets, having fewer subsequent exploration possibilities, can be assessedaccurately with higher confidence.Figure 7The correlation between the pre-dicted value of correct/incorrect nodes and theirheights.To systematically test this, we define the height of a node as itsshortest distance to any leaf node and analyze the relationshipbetween node height and the model’s estimated value. Ideally,a correct node—one that can lead to the target node—shouldreceive a high estimated value, whereas an incorrect node—onethat cannot lead to the target node—should receive a low value.Empirical results across the test set (Figure 7) support ourhypothesis: nodes with lower heights consistently receive moreaccurate and definitive probability evaluations. Conversely,nodeswithgreaterheightsexhibitmoreambiguousevaluations,reflecting increased uncertainty.These findings underscore the advantage of latent space rea-soning. By delaying deterministic decisions and allowing ex-ploration to proceed toward terminal states, latent reasoningsignificantly enhances the model’s ability to differentiate cor-rect paths from incorrect ones, thereby improving performanceon complex, planning-intensive tasks compared to traditionalgreedy methods.5 Empirical Results with CoconutAfter analyzing the promising parallel search pattern ofCo-conut, we validate the feasibility of LLM reasoning in a8
[[PDF PAGE 9]]Method GSM8k ProntoQA ProsQAAcc. (%) # Tokens Acc. (%) # Tokens Acc. (%) # TokensCoT 42.9±0.225.0 98.8±0.892.5 77.5±1.949.4No-CoT 16.5±0.52.2 93.8±0.73.0 76.7±1.08.2iCoT 30.0 ∗ 2.2 99.8±0.33.0 98.2±0.38.2Pause Token 16.4±1.82.2 77.7±21.03.0 75.9±0.78.2Coconut(Ours) 34.1±1.58.2 99.8±0.29.0 97.0±0.314.2-w/o curriculum14.4±0.88.2 52.4±0.49.0 76.1±0.214.2-w/o thought21.6±0.52.3 99.9±0.13.0 95.5±1.18.2-pause as thought24.1±0.72.2 100.0±0.13.0 96.6±0.88.2Table 1Results on three datasets: GSM8k, ProntoQA and ProsQA. Higher accuracy indicates stronger reasoningability, while generating fewer tokens indicates better efficiency.∗The result is from Deng et al. (2024).continuous latent space through more comprehensive experiments, highlighting its better reasoning efficiencyover language space, as well as its potential to enhance the model’s expressivity with test-time scaling.5.1 Experimental SetupMath Reasoning.We use GSM8k (Cobbe et al., 2021) as the dataset for math reasoning. It consists of gradeschool-level math problems. To train the model, we use a synthetic dataset generated by Deng et al. (2023).We use two continuous thoughts for each reasoning step (i.e.,c = 2). The model goes through 3 stages besidesthe initial stage. We then include an additional stage where still3×c continuous thoughts are used as inthe previous stage, but with all the remaining language reasoning chain removed. This handles the long-taildistribution of reasoning chains longer than 3 steps. We train the model for 6 epochs in the initial stage, and3 epochs in each remaining stage.Logical Reasoning.Logical reasoning involves the proper application of known conditions to prove or disprove aconclusion using logical rules. We use the ProntoQA (Saparov and He, 2022) dataset, and our newly proposedProsQA dataset, which is more challenging due to more distracting branches. We use one continuous thoughtfor every reasoning step (i.e.,c = 1). The model goes through 6 training stages in addition to the initial stage,because the maximum number of reasoning steps is 6 in these two datasets. The model then fully reasonswith continuous thoughts to solve the problems in the last stage. We train the model for 5 epochs per stage.For all datasets, after the standard schedule, the model stays in the final training stage, until reaching 50epochs. We select the checkpoint based on the accuracy on the validation set. For inference, we manually setthe number of continuous thoughts to be consistent with their final training stage. We use greedy decodingfor all experiments.5.2 Baselines and Variants of CoconutWe consider the following baselines: (1)CoT, and (2)No-CoT, which were introduced in Section 4. (3)iCoT(Deng et al., 2024): The model is trained with language reasoning chains and follows a carefully designedschedule that “internalizes” CoT. As the training goes on, tokens at the beginning of the reasoning chain aregradually removed until only the answer remains. During inference, the model directly predicts the answer.(4)Pause token(Goyal et al., 2023): The model is trained using only the question and answer without areasoning chain. However, different fromNo-CoT, special<pause> tokens are inserted between the questionand answer, which provides the model with additional computational capacity to derive the answer. Thenumber of<pause>tokens is set the same as continuous thoughts inCoconut.We also evaluate some variants ofCoconut: (1)w/o curriculum, which directly trains the model in thelast stage. The model uses continuous thoughts to solve the whole problem. (2)w/o thought: We keep themulti-stage training, but don’t add any continuous latent thoughts. While this is similar toiCoTin thehigh-level idea, the exact training schedule is set to be consistent withCoconut, instead ofiCoT, for a strict9
[[PDF PAGE 10]]comparison. (3)Pause as thought: We use special<pause> tokens to replace the continuous thoughts, andapply the same multi-stage training curriculum asCoconut.5.3 Results and DiscussionWe show the overall results in Table 1. Using continuous thoughts effectively enhances LLM reasoning overthe No-CoT baseline. For example, by using 6 continuous thoughts,Coconutachieves 34.1% accuracy onGSM8k, which significantly outperformsNo-CoT(16.5%). We highlight several key findings below.Figure 8Efficiency comparison of reasoningspace andCoconutwith differentc.“Chaining” continuous thoughts enhances reasoning.Language CoTproves to increase the effective depth of LLMs and enhance theirexpressiveness (Feng et al., 2023). Thus, generating more tokensserves as a way to inference-time scaling for reasoning (Guo et al.,2025; Snell et al., 2024). This desirable property holds naturallyforCoconuttoo. On GSM8k,Coconutoutperformed otherarchitectures trained with similar strategies, includingCoconut(pause as thought) andCoconut(w/o thought). Particularly,it surpasses the latest baselineiCoT(Deng et al., 2024), whichrequires a more carefully designed training schedule.Additionally, we experimented with adjusting the hyperparameterc, which controls the number of latent thoughts correspondingto one language reasoning step (Figure 8, II). As we increasedc from 0 to 1 to 2, the model’s performance steadily improved.2This further validates the potential of continuous thoughts to scaleup to harder problems. In two other synthetic tasks, we foundthat the variants ofCoconut(w/o thoughtsorpause as thought),and theiCoTbaseline also achieve impressive accuracy. Thisindicates that the model’s computational capacity may not bethe bottleneck in these tasks. In contrast, GSM8k involves morecomplex contextual understanding and modeling, placing higherdemands on computational capability.Figure 9Decoding a continuous thought into languagetokens in a math word problem. The decoded tokenscorrespond to intermediate variables that help solvethe problem.Continuous thoughts are efficient representations of rea-soning.Compared to traditional CoT,Coconutgen-erates fewer tokens while achieving higher accuracyon ProntoQA and ProsQA (Table 1). AlthoughCo-conutdoes not surpassCoTon GSM8k, it offers asuperior trade-off between reasoning efficiency and ac-curacy (Figure 8, I). To illustrate this, we train a seriesof CoT models that progressively “internalize” (Denget al., 2024) the initialm ={0, 1, 2, 3,ALL} reasoningsteps, and plot their accuracy versus the number ofgenerated tokens (labeled as “language” in the figure).These models quickly lose accuracy as more reasoningsteps are skipped. In contrast, by applyingCoconuttraining strategy—replacing each language reasoningstep with two continuous thoughts—the accuracy dropis substantially mitigated, maintaining higher perfor-mance even when fewer tokens are generated. Anotherinteresting observation is that, when we decode the firstcontinuous thought, it often corresponds to possible in-termediate variables in the calculation (Figure 9). Thisalso suggests that the continuous thoughts are moreefficient representations of reasoning.2We discuss the case of largercin Appendix C.1.10
[[PDF PAGE 11]]The LLM still needs guidance to learn latent reasoning.In the ideal case, the model should learn the most effectivecontinuous thoughts automatically through gradient descent on questions and answers (i.e.,Coconutw/ocurriculum). However, from the experimental results, we found the models trained this way do not performany better than no-CoT.On the contrary, with the multi-stage curriculum,Coconutis able to achieve top performance across varioustasks. The multi-stage training also integrates well with pause tokens (Coconut-pause as thought). Despiteusing the same architecture and similar multi-stage training objectives, we observed a small gap between theperformance ofiCoTandCoconut(w/o thoughts). The finer-grained removal schedule (token by token) anda few other tricks iniCoTmay ease the training process. We leave combiningiCoTandCoconutas futurework. While the multi-stage training used forCoconuthas proven effective, further research is definitelyneeded to develop better and more general strategies for learning reasoning in latent space, especially withoutthe supervision from language reasoning chains.6 ConclusionIn this paper, we introduceCoconut, a new paradigm for reasoning in continuous latent space. Experimentsdemonstrate thatCoconuteffectively enhances LLM performance across a variety of reasoning tasks.Reasoning in latent space gives rise to advanced emergent behaviors, where continuous thoughts can representmultiple alternative next steps. This enables the model to perform BFS over possible reasoning paths, ratherthan prematurely committing to a single deterministic trajectory as in language space CoT reasoning. Furtherresearch is needed to refine and scale latent reasoning to pretraining, which could improve generalizationacross a broader range of reasoning challenges. We hope our findings will spark continued exploration intolatent reasoning, ultimately advancing the development of more capable machine reasoning systems.11
[[PDF PAGE 12]]AcknowledgementThe authors express their sincere gratitude to Jihoon Tack for his valuable discussions throughout the courseof this work.ReferencesJosh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida,Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report.arXiv preprint arXiv:2303.08774,2023.Marie Amalric and Stanislas Dehaene. A distinct cortical network for mathematical knowledge in the human brain.NeuroImage, 189:19–31, 2019.Loïc Barrault, Paul-Ambroise Duquenne, Maha Elbayad, Artyom Kozhevnikov, Belen Alastruey, Pierre Andrews,Mariano Coria, Guillaume Couairon, Marta R Costa-jussà, David Dale, et al. Large concept models: Languagemodeling in a sentence representation space.arXiv preprint arXiv:2412.08821, 2024.Eden Biran, Daniela Gottesman, Sohee Yang, Mor Geva, and Amir Globerson. Hopping too late: Exploring thelimitations of large language models on multi-hop queries.arXiv preprint arXiv:2406.12775, 2024.Aydar Bulatov, Yury Kuratov, and Mikhail Burtsev. Recurrent memory transformer.Advances in Neural InformationProcessing Systems, 35, 2022.Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert,Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems.arXiv preprintarXiv:2110.14168, 2021.Yuntian Deng, Kiran Prasad, Roland Fernandez, Paul Smolensky, Vishrav Chaudhary, and Stuart Shieber. Implicitchain of thought reasoning via knowledge distillation.arXiv preprint arXiv:2311.01460, 2023.Yuntian Deng, Yejin Choi, and Stuart Shieber. From explicit cot to implicit cot: Learning to internalize cot step bystep.arXiv preprint arXiv:2405.14838, 2024.Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, AkhilMathur, Alan Schelten, Amy Yang, Angela Fan, et al. The llama 3 herd of models.arXiv preprint arXiv:2407.21783,2024.Ying Fan, Yilun Du, Kannan Ramchandran, and Kangwook Lee. Looped transformers for length generalization.arXivpreprint arXiv:2409.15647, 2024.Evelina Fedorenko, Michael K Behr, and Nancy Kanwisher. Functional specificity for high-level linguistic processing inthe human brain.Proceedings of the National Academy of Sciences, 108(39):16428–16433, 2011.Evelina Fedorenko, Steven T Piantadosi, and Edward AF Gibson. Language is primarily a tool for communicationrather than thought.Nature, 630(8017):575–586, 2024.Guhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye, Di He, and Liwei Wang. Towards revealing the mystery behindchain of thought: a theoretical perspective.Advances in Neural Information Processing Systems, 36, 2023.Kanishk Gandhi, Denise Lee, Gabriel Grand, Muxin Liu, Winson Cheng, Archit Sharma, and Noah D Goodman.Stream of search (sos): Learning to search in language.arXiv preprint arXiv:2404.03683, 2024.Jonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, Brian R Bartoldson, Bhavya Kailkhura,Abhinav Bhatele, and Tom Goldstein. Scaling up test-time compute with latent reasoning: A recurrent depthapproach.arXiv preprint arXiv:2502.05171, 2025.Angeliki Giannou, Shashank Rajput, Jy-yong Sohn, Kangwook Lee, Jason D Lee, and Dimitris Papailiopoulos. Loopedtransformers as programmable computers. InInternational Conference on Machine Learning, pages 11398–11442.PMLR, 2023.Alexi Gladstone, Ganesh Nanduru, Md Mofijul Islam, Peixuan Han, Hyeonjeong Ha, Aman Chadha, Yilun Du, HengJi, Jundong Li, and Tariq Iqbal. Energy-based transformers are scalable learners and thinkers.arXiv preprintarXiv:2507.02092, 2025.Sachin Goyal, Ziwei Ji, Ankit Singh Rawat, Aditya Krishna Menon, Sanjiv Kumar, and Vaishnavh Nagarajan. Thinkbefore you speak: Training language models with pause tokens.arXiv preprint arXiv:2310.02226, 2023.12
[[PDF PAGE 13]]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang,Xiao Bi, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning.arXiv preprintarXiv:2501.12948, 2025.Shibo Hao, Yi Gu, Haodi Ma, Joshua Jiahua Hong, Zhen Wang, Daisy Zhe Wang, and Zhiting Hu. Reasoning withlanguage model is planning with world model.arXiv preprint arXiv:2305.14992, 2023.Shibo Hao, Yi Gu, Haotian Luo, Tianyang Liu, Xiyan Shao, Xinyuan Wang, Shuhua Xie, Haodi Ma, Adithya Samavedhi,Qiyue Gao, et al. Llm reasoners: New evaluation, library, and analysis of step-by-step reasoning with large languagemodels.arXiv preprint arXiv:2404.05221, 2024.Alex Havrilla, Yuqing Du, Sharath Chandra Raparthy, Christoforos Nalmpantis, Jane Dwivedi-Yu, Maksym Zhuravin-skyi, Eric Hambro, Sainbayar Sukhbaatar, and Roberta Raileanu. Teaching large language models to reason withreinforcement learning.arXiv preprint arXiv:2403.04642, 2024.Tushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu, Kyle Richardson, Peter Clark, and Ashish Sabharwal.Decomposed prompting: A modular approach for solving complex tasks.arXiv preprint arXiv:2210.02406, 2022.Yann LeCun. A path towards autonomous machine intelligence version 0.9. 2, 2022-06-27.Open Review, 62(1):1–62,2022.Lucas Lehnert, Sainbayar Sukhbaatar, Paul Mcvay, Michael Rabbat, and Yuandong Tian. Beyond a*: Better planningwith transformers via search dynamics bootstrapping.arXiv preprint arXiv:2402.14083, 2024.Zhiyuan Li, Hong Liu, Denny Zhou, and Tengyu Ma. Chain of thought empowers transformers to solve inherentlyserial problems.arXiv preprint arXiv:2402.12875, 2024.Aman Madaan and Amir Yazdanbakhsh. Text and patterns: For effective chain of thought, it takes two to tango.arXiv preprint arXiv:2209.07686, 2022.William Merrill and Ashish Sabharwal. The expresssive power of transformers with chain of thought.arXiv preprintarXiv:2310.07923, 2023.Martin M Monti, Daniel N Osherson, Michael J Martinez, and Lawrence M Parsons. Functional neuroanatomy ofdeductive inference: a language-independent distributed network.Neuroimage, 37(3):1005–1016, 2007.Martin M Monti, Lawrence M Parsons, and Daniel N Osherson. The boundaries of language and thought in deductiveinference.Proceedings of the National Academy of Sciences, 106(30):12554–12559, 2009.Martin M Monti, Lawrence M Parsons, and Daniel N Osherson. Thought beyond language: neural dissociation ofalgebra and natural language.Psychological science, 23(8):914–922, 2012.Jacob Pfau, William Merrill, and Samuel R Bowman. Let’s think dot by dot: Hidden computation in transformerlanguage models.arXiv preprint arXiv:2404.15758, 2024.Chau Pham, Boyi Liu, Yingxiang Yang, Zhengyu Chen, Tianyi Liu, Jianbo Yuan, Bryan A Plummer, ZhaoranWang, and Hongxia Yang. Let models speak ciphers: Multiagent debate through embeddings.arXiv preprintarXiv:2310.06272, 2023.Ivan Rodkin, Yuri Kuratov, Aydar Bulatov, and Mikhail Burtsev. Associative recurrent memory transformer.arXivpreprint arXiv:2407.04841, 2024.Abulhair Saparov and He He. Language models are greedy reasoners: A systematic formal analysis of chain-of-thought.arXiv preprint arXiv:2210.01240, 2022.Yuval Shalev, Amir Feder, and Ariel Goldstein. Distributional reasoning in llms: Parallel reasoning processes inmulti-hop reasoning.arXiv preprint arXiv:2406.13858, 2024.Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Mingchuan Zhang, YK Li, Yu Wu, and DayaGuo. Deepseekmath: Pushing the limits of mathematical reasoning in open language models.arXiv preprintarXiv:2402.03300, 2024.Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. Scaling llm test-time compute optimally can be moreeffective than scaling model parameters.arXiv preprint arXiv:2408.03314, 2024.DiJia Su, Sainbayar Sukhbaatar, Michael Rabbat, Yuandong Tian, and Qinqing Zheng. Dualformer: Controllable fastand slow thinking by learning with randomized reasoning traces.arXiv preprint arXiv:2410.09918, 2024.13
[[PDF PAGE 14]]Miles Turpin, Julian Michael, Ethan Perez, and Samuel Bowman. Language models don’t always say what they think:unfaithful explanations in chain-of-thought prompting.Advances in Neural Information Processing Systems, 36,2024.Boshi Wang, Sewon Min, Xiang Deng, Jiaming Shen, You Wu, Luke Zettlemoyer, and Huan Sun. Towards understandingchain-of-thought prompting: An empirical study of what matters.arXiv preprint arXiv:2212.10001, 2022.Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. Math-shepherd:Verify and reinforce llms step-by-step without human annotations. InProceedings of the 62nd Annual Meeting of theAssociation for Computational Linguistics (Volume 1: Long Papers), pages 9426–9439, 2024.Xinyi Wang, Lucas Caccia, Oleksiy Ostapenko, Xingdi Yuan, William Yang Wang, and Alessandro Sordoni. Guidinglanguage model reasoning with planning tokens.arXiv preprint arXiv:2310.05707, 2023.Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al.Chain-of-thought prompting elicits reasoning in large language models.Advances in neural information processingsystems, 35:24824–24837, 2022.Yuxi Xie, Kenji Kawaguchi, Yiran Zhao, James Xu Zhao, Min-Yen Kan, Junxian He, and Michael Xie. Self-evaluationguided beam search for reasoning.Advances in Neural Information Processing Systems, 36, 2023.Sohee Yang, Elena Gribovskaya, Nora Kassner, Mor Geva, and Sebastian Riedel. Do large language models latentlyperform multi-hop reasoning?arXiv preprint arXiv:2402.16837, 2024.Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Tom Griffiths, Yuan Cao, and Karthik Narasimhan. Tree ofthoughts: Deliberate problem solving with large language models.Advances in Neural Information ProcessingSystems, 36, 2023.Fangxu Yu, Lai Jiang, Haoqiang Kang, Shibo Hao, and Lianhui Qin. Flow of reasoning: Efficient training of llm policywith divergent thinking.arXiv preprint arXiv:2406.05673, 2024a.Longhui Yu, Weisen Jiang, Han Shi, Jincheng Yu, Zhengying Liu, Yu Zhang, James T Kwok, Zhenguo Li, AdrianWeller, and Weiyang Liu. Metamath: Bootstrap your own mathematical questions for large language models.arXivpreprint arXiv:2309.12284, 2023.Ping Yu, Jing Xu, Jason Weston, and Ilia Kulikov. Distilling system 2 into system 1.arXiv preprint arXiv:2407.06023,2024b.Xiang Yue, Xingwei Qu, Ge Zhang, Yao Fu, Wenhao Huang, Huan Sun, Yu Su, and Wenhu Chen. Mammoth: Buildingmath generalist models through hybrid instruction tuning.arXiv preprint arXiv:2309.05653, 2023.Eric Zelikman, Georges Harik, Yijia Shao, Varuna Jayasiri, Nick Haber, and Noah D Goodman. Quiet-star: Languagemodels can teach themselves to think before speaking.arXiv preprint arXiv:2403.09629, 2024.Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, Claire Cui,Olivier Bousquet, Quoc Le, et al. Least-to-most prompting enables complex reasoning in large language models.arXiv preprint arXiv:2205.10625, 2022.Hanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao, Stuart Russell, and Yuandong Tian. Emergence of superposition:Unveiling the training dynamics of chain of continuous thought.arXiv preprint arXiv:2509.23365, 2025a.Hanlin Zhu, Shibo Hao, Zhiting Hu, Jiantao Jiao, Stuart Russell, and Yuandong Tian. Reasoning by superposition: Atheoretical perspective on chain of continuous thought.arXiv preprint arXiv:2505.12514, 2025b.14
[[PDF PAGE 15]]AppendixA DatasetsA.1 ExamplesWe provide some examples of the questions and CoT solutions for the datasets used in our experiments.GSM8kQuestion = "John cuts his grass to 2 inches. It grows .5 inches per month. When it gets to 4inches he cuts it back down to 2 inches. It cost $100 to get his grass cut. How much does he payper year?"Steps = ["«4-2=2»", "«2/.5=4»", "«12/4=3»", "«100*3=300»"]Answer = "300"ProntoQAQuestion = "Brimpuses are not luminous. Shumpuses are amenable. Each yumpus is a lorpus.Gorpuses are shumpuses. Each zumpus is a grimpus. Gorpuses are rompuses. Dumpuses arenot floral. Lempuses are cold. Brimpuses are impuses. Every lorpus is floral. Every rompusis transparent. Grimpuses are muffled. Rompuses are yumpuses. Rompuses are wumpuses.Zumpuses are fast. Wumpuses are bitter. Every sterpus is orange. Each lorpus is a vumpus.Yumpuses are feisty. Each yumpus is a lempus. Gorpuses are snowy. Zumpuses are gorpuses.Every lorpus is a sterpus. Stella is a brimpus. Stella is a zumpus. True or false: Stella is notfloral."Steps = ["Stella is a zumpus. Zumpuses are gorpuses.", "Stella is a gorpus. Gorpuses arerompuses.", "Stella is a rompus. Rompuses are yumpuses.", "Stella is a yumpus. Each yumpusis a lorpus.", "Stella is a lorpus. Every lorpus is floral.", "Stella is floral."]Answer = "False"ProsQAQuestion = "Every shumpus is a rempus. Every shumpus is a yimpus. Every terpus is a fompus.Every terpus is a gerpus. Every gerpus is a brimpus. Alex is a rempus. Every rorpus is ascrompus. Every rorpus is a yimpus. Every terpus is a brimpus. Every brimpus is a lempus.Tom is a terpus. Every shumpus is a timpus. Every yimpus is a boompus. Davis is a shumpus.Every gerpus is a lorpus. Davis is a fompus. Every shumpus is a boompus. Every shumpus is arorpus. Every terpus is a lorpus. Every boompus is a timpus. Every fompus is a yerpus. Tom isa dumpus. Every rempus is a rorpus. Is Tom a lempus or scrompus?"Steps = ["Tom is a terpus.", "Every terpus is a brimpus.", "Every brimpus is a lempus."]Answer = "Tom is a lempus."A.2 Construction of ProsQATo construct the dataset, we first compile a set of typical entity names, such as “Alex” and “Jack,” alongwith fictional concept names like “lorpus” and “rorpus,” following the setting of ProntoQA (Saparov and He,2022). Each problem is structured as a binary question: “Is [Entity] a [Concept A] or [Concept B]?” Assuming[Concept A] is the correct answer, we build a directed acyclic graph (DAG) where each node represents anentity or a concept. The graph is constructed such that a path exists from [Entity] to [Concept A] but not to[Concept B].Algorithm 1 describes the graph construction process. The DAG is incrementally built by adding nodes andrandomly connecting them with edges. To preserve the validity of the binary choice, with some probability, we15
[[PDF PAGE 16]]# Nodes # Edges Len. of Shortest Path # Shortest Paths23.0 36.0 3.8 1.6Table 2Statistics of the graph structure in ProsQA.enforce that the new node cannot simultaneously serve as a descendant to both node0and1. This separationmaintains distinct families of nodes and balances their sizes to prevent model shortcuts.After the graph is constructed, nodes without parents are assigned entity names, while other nodes receiveconcept names. To formulate a question of the form “Is [Entity] a [Concept A] or [Concept B]?”, we designatenode0in the graph as [Entity], a leaf node labeled1as [Concept A], and a leaf node labeled2as [Concept B].This setup ensures a path from [Entity] to [Concept A] without any connection to [Concept B], introducing amoderately complex reasoning path. Finally, to avoid positional biases, [Concept A] and [Concept B] arerandomly permuted in each question.Algorithm 1Graph Construction for ProsQAedges←{}nodes←{0,1}labels←{0 : 1,1 : 2}▷Labels: 1 (descendant of node 0), 2 (descendant of node 1), 3 (both), 0 (neither).groups←{0 :{},1 :{0},2 :{1},3 :{}}idx←2whileidx < Ndo▷For each new node, randomly add edges from existing nodesn_in_nodes←poisson(1.5)rand←random()ifrand≤0.35thencandidates←groups[0]∪groups[1]▷Cannot be a descendant of node 1.else ifrand≤0.7thencandidates←groups[0]∪groups[2]▷Cannot be a descendant of node 0.elsecandidates←nodesend ifn_in_nodes←min(len(candidates), n_in_nodes)weights←[depth_to_root(c)·1.5 + 1∀c∈candidates]▷Define sampling weights to prioritize deeper nodes.▷This way, the solution reasoning chain is expected to be longer.in_nodes←random_choice(candidates, n_in_nodes,prob=weights/sum(weights))cur_label←0forin_idx∈in_nodesdocur_label←cur_label|labels[in_idx]▷Update label using bitwise OR.edges.append((in_idx, idx))end forgroups[cur_label].append(idx)labels[idx]←cur_labelnodes←nodes∪{idx}idx←idx+ 1end whileA.3 StatisticsWe show the size of all datasets in Table 3.16
[[PDF PAGE 17]]Dataset Training Validation TestGSM8k 385,620 500 1319ProntoQA 9,000 200 800ProsQA 17,886 300 500Table 3Statistics of the datasets.B Clock-Time Reasoning Efficiency MetricWe present a clock-time comparison to evaluate reasoning efficiency. The reported values represent the averageinference time per test case (in seconds), with a batch size of 1, measured on an Nvidia A100 GPU. For theno-CoT and CoT baselines, we employ the standard generate method from thetransformers3 library. Ourresults show that clock time is generally proportional to the number of newly generated tokens, as detailed inTable 1.Method GSM8k ProntoQA ProsQANo-CoT 0.03 0.03 0.08CoT 0.26 0.85 0.47Coconut0.09 0.11 0.15Table 4Inference time (in seconds) comparison across tasks and methods.C More DiscussionC.1 Using More Continuous ThoughtsIn Figure 8 (II), we present the performance ofCoconuton GSM8k usingc∈{ 0, 1, 2}. When experimentingwith c = 3, we observe a slight performance drop accompanied by increased variance. Analysis of the traininglogs indicates that adding three continuous thoughts at once – particularly during the final stage transition –leads to a sharp spike in training loss, causing instability. Future work will explore finer-grained schedules,such as incrementally adding continuous thoughts one at a time while removing fewer language tokens, asin iCoT (Deng et al., 2024). Additionally, combining language and latent reasoning—e.g., generating thereasoning skeleton in language and completing the reasoning process in latent space—could provide a promisingdirection for improving performance and stability.C.2 Coconut with Larger ModelsWe experimented withCoconuton GSM8k using Llama 3.2-3B and Llama 3-8B (Dubey et al., 2024) withc = 1. We train them for 3 epochs in Stage 0, followed by 1 epoch per subsequent stage. The results areshown in Table 5.Model no-CoT Coconut (Ours)Llama 3.2-3B 26.0 31.7Llama 3-8B 42.2 43.6Table 5Experimental results of applyingCoconutto larger Llama models. We report performance comparisonsbetween models without CoT reasoning (no-CoT) and our proposedCoconutmethod.We observe consistent performance gains across both Llama 3.2-3B and Llama 3-8B models compared tothe no-CoT baseline, though these improvements are not as pronounced as those previously demonstrated3https://github.com/huggingface/transformers17
[[PDF PAGE 18]]with GPT-2. One possible reason is that larger models have already undergone extensive language-focusedpre-training, making the transition to latent reasoning more challenging.We emphasize that the primary goal of this paper is to highlight the promising attributes of latent-spacereasoning and to initiate exploration in this new direction. Universally surpassing language-based CoT likelyrequires significant research efforts dedicated tolatent space pre-training. We are encouraged by recent progressin this area (Geiping et al., 2025; Barrault et al., 2024; Gladstone et al., 2025). While these recent modelsprovide scalable methods for latent representation learning, the latent spaces have not yet been explicitlyoptimized for reasoning. Integrating these recent advancements withCoconutpresents an exciting andpromising avenue for future research.18123version https://git-lfs.github.com/spec/v1oid sha256:96fdfc56cee0bc9441d5f7da96ec8155ef8666c968d155034fb44af07cc2b941size 8949881234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137[[PDF PAGE 1]]Composition Collapse: Stable Factual KnowledgeDoes Not Imply Compositional ReasoningZhe Yu2∗ Wenpeng Xing1,2∗ Yunzhao Wei2 Jie Chen3Hongzhi Wang4 Xuyang Teng5 Meng Han1,2,61Zhejiang University 2Binjiang Institute of Zhejiang University3Hong Kong Baptist University 4Harbin Institute of Technology 5Hangzhou Dianzi University6GenTel.io∗Equal contributionAbstractPost-training is routinely evaluated through ag-gregate benchmark scores that treat multi-hopreasoning as a single capability—as if a modelthat answers more questions correctly must bebetter at assembling facts. We show that thisassumption can be misleading: recipes with sta-tistically indistinguishable atomic knowledgeproduce composition behaviour separated byover 40 percentage points, a phenomenon wecallcomposition collapse: the systematic fail-ure to assemble stably-known facts into chains,invisible to aggregate metrics. We introducea double-gate protocol that changes the esti-mand from an aggregate compositionality gapto residual composition failure conditionedon stable atomic access, decomposing post-training gains into three independent channels:atomic stability, residual composition, and crit-ical depth. On a benchmark of temporal factualchains spanning depths 2–11 across four post-training recipes, this decomposition reveals thatpost-training objectives shift composition capa-bility in directions that aggregate metrics mask,and suggests that claims about multi-hop rea-soning improvement should be accompaniedby atomic-gate-controlled composition metrics.Diagnostic probes further show that a substan-tial share of measured composition failure re-flects generation-time computation constraintsrather than permanent inability to compose.1 IntroductionWhen a language model fails a multi-hop question—which came first, the telephone or flight?—twoexplanations are possible. Either the model doesnot reliably know the dates, or it knows both andstill cannot compare them. These demand differentfixes: more factual knowledge versus better compo-sitional reasoning. Yet standard evaluation practicetreats them as the same thing.The field evaluates multi-hop reasoning throughaggregate benchmark accuracy on datasets like Hot-potQA (Yang et al., 2018): a model that answersmore composite questions correctly is assumed tobe better at composing facts. Thecompositionalitygap(Press et al., 2023; Dziri et al., 2023)—the dropfrom single-hop to multi-hop accuracy—is widelyused to quantify composition failure. But thismetric conflates two categorically different failuremodes. A model may answer a sub-question cor-rectly once withoutstableaccess to the underlyingfact, yet a single correct answer does not guaranteethe model can reproduce that knowledge in a longerchain. Attributing the entire gap to “compositionfailure” mixes atomic-instability variance into whatis claimed as a reasoning deficit. Prior work hasshown that knowledge extraction can fail system-atically even when facts are present in the train-ing distribution (Allen-Zhu and Li, 2023), and thatmulti-hop failures can be localised to specific layer-level timing problems (Biran et al., 2024). Recentwork on shortcut-free latent multi-hop evaluation(SOCRATES; Yang et al. (2025)) shows that com-position success varies dramatically by entity typeeven when atomic facts are known—reinforcingthe need to measure composition net of atom con-fidence. These studies establish that reasoningfailures exist independently of memorisation—apremise we share. But they do not provide a mea-surement protocol that cleanly separates the twofailure modes at evaluation time.This conflation is not a minor measurement issue.Two post-training recipes whose atomic stabilitydiffers by less than two percentage points can di-verge by over 40 pp in residual composition failureat the shallowest non-trivial depth. We call thiscomposition collapse: the systematic failure to as-semble stably-known facts into correct chains, hid-den from aggregate metrics and visible only whenatomic knowledge is controlled for.We introduce adouble-gate protocolthatchanges the estimand from an aggregate gap toresidual composition failure conditioned on stableatomic access. Before measuring whether a modelarXiv:2605.26789v1 [cs.AI] 26 May 2026
[[PDF PAGE 2]]can compose facts, the protocol first verifies thatit stably possesses each fact (consistency acrossparaphrases) and can answer each sub-question inisolation. Errors that survive both gates areresidualcomposition failure: the model stably knows theparts, has verbalised them one at a time, and stillfails to assemble them. With this protocol, post-training gains decompose into three independentchannels: ∆atom (atomic stability), ∆comp (residualcomposition at matched atoms), and ∆depth (thedepth at which residual failure exceeds 50%). Weinstantiate the protocol on D4V2, a 390-questiontemporal benchmark spanning four task families atdepths 2–11.The benchmark covers temporal factual chains(dates, events, causal order); domain generalitybeyond temporal reasoning remains open and isexamined preliminarily through in-context probesand a cross-domain pilot (§4).We evaluate six open-weights models at 7–13Bscale spanning four post-training recipes—base,RLHF (Ouyang et al., 2022), SFT reasoning-tracedistillation, and native outcome-verified RL—andrun a controlled same-base Hu et al. (2022) LoRAintervention (SFT-answer, SFT-trace, Shao et al.(2024) GRPO) that isolates the training objec-tive from base-model confounds. Three findingsemerge. First, base models are filtered by atomicknowledge, not composition—their atomic gate ad-mits<5 cases at any depth. Second, at matchedatomic stability, residual failure ranges from 0%to 47% at depth 2 depending on the training ob-jective, and outcome-verified RL outperforms SFTdistillation by a wide margin under identical dataand compute. Third, training on a compositiondepth closes most of that depth’s residual failuregap but transfers only weakly to adjacent held-outdepths. Enabling chain-of-thought reasoning re-duces residual failure by 3–5× (§6), locating muchof the bottleneck in generation-time computation,not in static knowledge representation. Our con-tributions are: (i) a double-gate protocol that pro-vides a cleaner measurement of composition net ofatomic knowledge; (ii) a three-channel decompo-sition that makes post-training recipes comparableon a like-for-like basis; and (iii) a controlled causalintervention isolating a post-training-specific com-position channel with limited depth transfer. Wedo not claim to reveal the essence of post-training;rather, we offer a measurement protocol that ex-poses previously hidden variation across recipes atmatched atoms.2 Related WorkMeasuring the compositionality gap.Press et al.(2023) formalised the compositionality gap as thedrop from single-hop to multi-hop accuracy; Dziriet al. (2023) showed Transformer performance onmulti-hop composition degrades with chain length.Yang et al. (2025) introduced latent multi-hopprobes (SOCRATES) that bypass surface shortcuts,showing composition success varies dramaticallyby entity type even when atomic facts are known.These frameworks share a confound: the single-hop baseline does not verify that facts arestablyaccessible—a single correct sub-question answerdoes not guarantee the model can reproduce thatknowledge when the same fact appears embeddedin a chain. Our double-gate protocol adds a per-factstability filter that separates transient retrieval fromstable knowledge, converting a population-levelcorrection into a per-case admissibility test.Post-training and reasoning.RLHF (Ouyanget al., 2022), SFT reasoning-trace distillation (Weiet al., 2022; DeepSeek-AI et al., 2025), andoutcome-verified RL (Shao et al., 2024) are thedominant paradigms for improving reasoning.Prior work evaluates these recipes through aggre-gate benchmark scores, which conflate knowledgeacquisition with reasoning improvement. Our three-channel decomposition shows these recipes shiftatomic stability and residual composition indepen-dently: atomic stability saturates after the base-to-instruct jump, while residual composition varies by40+ pp across recipes at matched atoms. This de-composition is orthogonal to the training objective:it provides a measurement lens, not a modellingclaim.Computation and composition.Biran et al.(2024) localised multi-hop failure to layer-leveltiming—the model encodes both facts but pro-cesses the second too late. Allen-Zhu and Li (2023)showed knowledge extraction fails systematicallyeven when facts are in the training distribution, andCoT data during training can bridge the gap. OurCoT diagnostic (§6) complements these findings:enabling CoT at inference time recovers 70–75%of gate-passing failures, locating much of the resid-ual failure in generation-time computation ratherthan permanent representational deficit. Togetherwith the patching experiment (Appendix I), whichfinds negligible information in prompt-end repre-sentations, these results triangulate the bottleneckto the generation process itself.
[[PDF PAGE 3]]Which came first:telephone or flight? DecomposeA = {a1 , a2} telephonedateflightdateS = {s1 , s2} When was telephone …?When was flight …?I. Gate 1: Atomic StabilityInput: A = {a1 , a2}telephonedatep₁ p₂ p₃paraphrase probes✓flightdatep₁ p₂ p₃paraphrase probes × KnowledgeinstabilityII. Gate 2: Sub-question CorrectnessInput: S = {s1 , s2}III. Residual Composition Failurestableatoms ✓+sub-questions ✓qWhich came first:telephone or flight?LLMmodelanswerflight≠goldanswertelephone×ResidualCompositionFailuref (M | gate) =wrong main answergate-passing casesThree-Channel Decompositionatomicstabilityresidual compositionfailure ×critical depth d50… …qLLMLLMGate 1 PASS:stable atomic access ΔatomΔcompΔdepth50% failured50+ …?? ✓? ✓✓✓?s1 s2a1 a2a2a1✓ ✓ ✓× ✓✓ ✓ ? ✓? ✓sub-questionsatomic facts: 1876 : 1903Paraphrase-stable?Double-Gate ProtocolWhen was telephone …?LLMWhen was flight …?LLM✓× Sub-question errorSub-questionsCorrect?Gate 2 PASS:all sub-questions correct1876gold:18761903gold:1903==??s2s1Figure 1:Double-gate protocol for measuring residual composition failure.A multi-hop question is decomposedinto atomic facts and aligned sub-questions.I.Atomic Stability verifies stable and correct access to each atomacross paraphrases.II.Sub-question Correctness verifies that each sub-question is answered correctly in isolation.III.Residual Composition Failure measures whether the original multi-hop question is still answered incorrectlyafter both gates are passed. This separates composition errors from unstable knowledge access and supports thethree-channel decomposition into∆ atom,∆ comp, and∆ depth.3 MethodFigure 1 summarises the pipeline. A compositioninstance is a main question q whose answer re-quiresk atomic factsa1,...,a k (the depth). Eachatom carries mi paraphrased probes plus a sub-questionsi matching how the atom appears in thechain. An instancepasses the atomic gateiff ev-ery atom is answered consistently across all para-phrases (consistency matcher of Press et al., 2023);itpasses the sub-question gateiff every si is cor-rect in isolation. Our primary quantity is theresid-ual composition failure rate: the fraction of gate-passing instances whose main answer is still wrong.By construction it upper-bounds pure compositionfailure—format artifacts, distractor attention, andgreedy-trajectory degeneracy can inflate the mea-sured rate without reflecting genuine compositionalinability (we quantify this margin in §7).Given a recipeR and a matched comparatorR′(atomic stabilities within 2 pp), we decompose thepost-training benefit into three channels:∆atom(R) =s(M R)−s(M R′),∆comp(R) =f(M R|gate)−f(M R′|gate),∆depth(R) =d 50(MR)−d 50(MR′),wheres is atom stability,f is residual compositionfailure, andd50 is the depth at whichf first exceeds50%. When atomic stabilities are matched, ∆compisolates a pure composition benefit; the ∆comp–∆depth gap later lets us distinguish a training-dataeffect from a model-structure effect.Benchmark.D4V2 contains 390 main ques-tions and 2 490 atomic sub-questions builtfrom four task families: a depth-2 pair-ordering control and three depth-covering families(TEMPORAL_RANK,TEMPORAL_SUCCESSOR,TEMPORAL_INTERVAL_DECOY) at d∈{4,6,8} ,withTEMPORAL_INTERVAL_DECOYadditionallysampling intermediate fact counts ( d=7,9,11 ;n=30 each). Task families differ in requiredchain structure—ranking a set, stepping forward intime, and disambiguating overlapping intervals—so same-depth cases are not interchangeable in diffi-culty. To enable cross-family comparison at shareddepth bins, we group depth-7 cases with depth 4,depth 9 with depth 6, and depth 11 with depth 8(see Appendix B for rationale and full breakdown).Three additional synthetic task families (KINSHIP,NUMERICAL,SPATIAL) built from fictional entitiesform a separate evaluation suite; as discussed in§4, they are excluded because our closed-book pro-
[[PDF PAGE 4]]2 4 6 8Chain depth d020406080100Residual composition failure (%)n=17n=38n=19n=11n=25n=53n=38n=33n=19n=42n=26n=15n=16n=27 n=9n=4Qwen3-8B (RLVR)Qwen2.5-7B-Inst (RLHF)DeepHermes-3 (SFT dist.)Mistral-7B-Inst (RLHF)Figure 2:The composition collapse curve.Residualcomposition failure rate versus depth on D4V2 (boot-strap 95% CI). All gate-passing recipes cross 50% fail-ure by depth 4–5; two reach 100% by depth 8. Basemodels are omitted (see Appendix C); their atomic gateadmits<5 cases at every depth. CI width grows withdepth as gate-passing n declines; points at depth 8should be interpreted with particular caution (n≤37for all recipes).tocol cannot evaluate composition when internalatomic knowledge is absent.Recipe coverage and evaluation.We evaluatefour post-training recipes: base, RLHF, SFT dis-tillation of reasoning traces, and native outcome-verified RL (RLVR), across six open-weights mod-els at the 7–13B scale (checkpoints in Appendix C).All numbers use the Press et al. consistencymatcher; full adjudication tiers and vLLM vs. Hug-gingFace cross-validation are in Appendix K and H.Inference is greedy (T=0), XML-structured.4 Experiments and ResultsWe report three observations that rule out the mostobvious alternative explanations and isolate a post-training-specific composition channel. First, theatomic gate removes base models entirely, so thefailures we measure are not knowledge gaps (§4,paragraph 1). Second, two recipes with statisticallyindistinguishable atomic knowledge produce cat-egorically different composition at the shallowestnon-trivial depth (paragraph 2). Third, within afixed depth, task structure changes residual failureby up to 66 percentage points, so depth is not thedominant axis of difficulty (paragraph 3).Figure 2 shows residual composition failure asa function of chain depth, with bootstrap 95% CIsover atomic-gate passing cases.Base models are filtered by knowledge, not com-position.All three pre-RLHF base models wetest (Llama-3-8B (AI@Meta, 2024), Mistral-7B-Table 1: Residual composition failure rate (%) by depthon D4V2, restricted to gate-passing post-trained models.“Atom stab.” is the per-probe atomic-stability rate; theatomic gate imposes a stricter per-fact criterion, so theeffective fact-level pass rate is lower. Parenthesisedvalues aren, the number of atomic-gate-passing cases.We omitn<5.Model Stab. (%)d= 2d= 4d= 6d= 8Qwen3-8B (Team, 2025) (RLVR) 87.7 0.0 (17) 55.3 (38) 78.9 (19) 100.0 (11) †Qwen2.5-7B-Inst (Yang et al., 2024) (RLHF) 89.9 12.0 (25) 69.8 (53) 78.9 (38) 81.1 (37)DeepHermes-3 (Teknium et al., 2025) (SFT distill) 88.0 47.4 (19) 61.9 (42) 73.1 (26) 100.0 (15) †Mistral-7B-Inst (Jiang et al., 2023) (RLHF) 78.8 25.0 (16) 55.6 (27) 66.7 ( 9) † –† n<15gate-passing cases; point estimates in these cellsshould be interpreted with caution—bootstrap CIs exceed±25 pp.v0.1 (Jiang et al., 2023), Qwen2.5-7B (Yang et al.,2024)) have atomic stability below 15%, so theirjoint stability at depthk is near zero and the atomicgate admits fewer than five cases at any depth. At-tributing their failure to “composition” would be acategory error—precisely the confound our proto-col is designed to remove. Full per-model atomicrates are reported in Appendix C.Synthetic task families are excluded by design.Three synthetic families (KINSHIP,NUMERICAL,SPATIAL) built from fictional entities are part of thefull suite but are excluded because no model canpossess internal knowledge of entities absent fromits training data (atomic accuracy = 0%); the pro-tocol correctly prevents composition measurementwhen atoms are absent. We therefore restrict analy-sis to temporal facts where models demonstrablypossess the requisite knowledge.4.0.1 Composition collapse persists underin-context evidenceTo verify that composition difficulty is not merelyan artefact of closed-book knowledge access, weevaluated Qwen2.5-7B-Instruct on the same syn-thetic families with all facts supplied in the promptas [Evidence] blocks. Under this in-context pro-tocol, only 21.8% of cases survive the sub-questiongate, and on those gate-passing cases residualcomposition failure is 88.9% (Table 2). Thisconvergence—88.9% in-context versus 55–100%closed-book at matched depths—rules out knowl-edge retrieval as the dominant explanation for com-position collapse. When the relevant facts are sup-plied in the prompt and gate-passing cases are con-ditioned on correct sub-question use, compositionremains the primary failure mode; the bottleneckis assembly, not lookup.
[[PDF PAGE 5]]Table 2: In-context composition on synthetic families(Qwen2.5-7B-Instruct). Facts are supplied in the prompt.“Atom pass” = all sub-questions correct. Residual failure= main-question error given atom pass.Task familynAtom pass Residual failure (%)Kinship (matrilineal) 33 8 62.5Kinship (patrilineal) 33 9 66.7Spatial (eastward) 33 12 91.7Spatial (northward) 33 6 83.3Numerical (offset) 33 1 100.0Aggregate 165 36 88.9Quantifying the conflation.We recompute resid-ual failure using only the sub-question gate (thestandard single-gate protocol). The aggregatesingle-gate rate exceeds the double-gate rate by2.5–9.8 pp across models, but the cell-level infla-tion peaks at 11.4 pp, and the atomic gate removes15–44% of single-gate-passing cases—cases priorwork would count as valid composition trials whoseconstituent atoms are not stably known. These find-ings motivate the double-gate protocol not as arefinement but as a correction of the estimand.Matched atoms, divergent composition: thecomposition collapse.Three recipes admittedby the gate cluster tightly on atomic stability—Qwen3 87.7%, DeepHermes 88.0%, Qwen2.5-Instruct 89.9%—yet collapse to 0%, 47%, and12% residual composition failure at depth 2 (Ta-ble 1). Thiscomposition collapse—a 47-point gapbetween a native outcome-verified RL model anda recipe that merely imitates its reasoning traces—is the paper’s cleanest correlational signal: at theknowledge level these recipes are indistinguishable,at the composition level they are categorically dif-ferent.Limited depth transfer under current recipes.Table 1 shows that all four gate-passing recipes sitat or above 67% residual failure by depth 6, andevery reportable measurement at depth 8 is 75% orhigher; Qwen3 and DeepHermes both reach 100%.The best recipe we evaluate pushesd50 no higherthan 5–6 hops. Within our recipe coverage—twoRLHF variants, an SFT reasoning-trace distillation,and a native RLVR model—the depth ceiling doesnot meaningfully move, suggesting that currentpost-training recipes improve shallow compositionmore reliably than depth extrapolation.Structure dominates depth.At fixed depth 4,Qwen3’s residual failure ranges from 38.5% onTable 3: Residual failure (%) by task family and depthfor Qwen3-8B (double gate). At fixed depth, task struc-ture changes failure by up to 54 pp. Parenthesised valuesaren. “–” =n<5.Task familyd=2d=4d=6d=8Pair control 0.0 (17) – – –Temp. successor – 38.5 (13) 88.9 ( 9) –Temp. int. decoy – 41.2 (17) 57.1 ( 7) 80.0 (5)Temp. rank – 92.9 (14) 83.3 ( 6) 100.0 (6)TEMPORAL_SUCCESSORto 92.9% onTEMPO-RAL_RANK—a 54-point gap at identical chainlength (Table 3). The within-depth spread evenexceeds the within-task depth progression onTEM-PORAL_INTERVAL_DECOY(41% at d=4→ 57%atd=6→ 80% atd=8). The ordering of models byresidual failure reverses across task families, whichis incompatible with any account that treats depthas a monotone difficulty axis.4.1 Decomposition into three channelsHaving established that composition failure sur-vives the atomic gate and varies dramatically acrossrecipes, we decompose post-training benefits intothe three channels of §3: atomic stability (∆atom),residual composition accuracy at matched atoms(∆comp), and critical depth (∆depth).4.1.1∆ atom: post-training buys atomicstability in large stepsThe base-to-instruct jump is 76–88 pp of atomicstability; once paid, further improvements are sin-gle percentage points. For a 7–13B model, “doespost-training help composition?” is first a ques-tion about whether the atoms ever become stableenough to attempt composition.4.1.2∆ comp: at matched atoms, recipematters by 40+ppAt matched atomic stability (87–90%), the threegate-passing recipes diverge by 47 pp at depth 2(Table 1): taking Qwen3 (RLVR) as reference,∆comp is−47.4 pp (DeepHermes) and −12.0 pp(Qwen2.5-Inst). Two recipes indistinguishable onknowledge benchmarks differ by 35 pp in residualcomposition. The collapse of SFT-distilled rea-soning suggests that distilling reasoning traces caninduce surface pattern-matching that generalisesworse than outcome-verified RL. Base-model con-founds for DeepHermes (Llama-3 vs. Qwen2) arepartly addressed via R1-distill comparisons in Ap-pendix C.
[[PDF PAGE 6]]Table 4: Critical depth (d50) per task family, consistencygate. d50 is estimated by linear interpolation betweenthe two depth bins ({2,4,6,8} ) bracketing 50% residualfailure. Ranges reflect the uncertainty band from the95% Clopper–Pearson CI on the underlying binomialrates. All values are approximate due to the coarse 4-binresolution and small gate-passing sample sizes at deeperdepths.ModelRANK SUCC.INT_DECOYAgg.Qwen3 (RLVR)<4 [4,6] [4,6] [3,5]Qwen2.5-Inst (RLHF)<4 [4,6] [4,6] [3,5]DeepHermes (SFT)<4<4<4<3Mistral-Inst (RLHF)<4<4 [4,5]<34.1.3∆ depth: shallow depth generalisationAcross post-trained models,d50 averages in [3,5](Table 4). Even the strongest recipe does not ex-ceedd50=5–6, andTEMPORAL_RANKpushes d50below 4 for every model. Post-training improvesshallow composition more reliably than depth ex-trapolation.5 Causal intervention: training reducesseen-depth collapse with limitedtransferThe cross-recipe analysis in §4 is correlational. Torule out confounding by base model, we train fourcontrolled LoRA-GRPO variants on Qwen2.5-7B-Instruct(Yang et al., 2024) 1: v1 trains on depths{2,4} , v2 on{2,4,6} , v3 on{2,4,6} with heav-ier budget (rank 64, 8 epochs), and v4 extendsthe heavy-budget setup to train on{2,4,6,8} . v1holds out depths{6,8} at test time; v2 and v3 holdout{8}; v4, which trains on all four D4V2 depths{2,4,6,8} , evaluates depth 8 in-distribution. Eval-uation uses the same protocol as §4.Four causal conclusions.(1) RL on compositionimproves composition net of atoms.Training cutsdepth-4 residual failure by 45–62 pp across vari-ants while atomic stability moves by 1–3 pp; theeffect is a clean ∆comp. At depths 4 and 6, baselineand GRPO v1 bootstrap CIs are disjoint (Figure 3).(2) OOD depth generalisation decays.Training on{2,4} generalises 20 pp to depth 6, but only 7 ppto depth 8.(3) In-distribution gains do not trans-fer to deeper hold-out depths—unless the deeper1All variants use learning rate 10−5, 8 generations perprompt, reward = consistency match + XML format + anti-template-echo, Team (2024) (memory-efficient LoRA (Huet al., 2022)) with patched TRL. v1/v2: LoRA rank 32, 4epochs,∼1 h. v3/v4: LoRA rank 64, 8 epochs,∼3.2 h (v3) /∼5 h (v4). Details in Appendix F.2 4 6 8Chain depth d020406080100Residual composition failure (%)v1 train {2,4} v2/v3 extend to 6 v4 extends to 8Qwen2.5-Instruct (baseline)GRPO v1 (train {2,4}, r32)GRPO v2 (train {2,4,6}, r32)GRPO v3 (train {2,4,6}, r64)GRPO v4 (train {2,4,6,8}, r64)Figure 3: Baseline (Qwen2.5-Instruct, dotted) vs. fourLoRA-GRPO variants. Shaded bands mark training-depth regions. v1/v2 (rank 32, 4 epochs) show thatadding depth-6 training improvesd=6 but notd=8; v3(rank 64, 8 epochs) further reducesd=6 to 27.9% withminimal d=8 transfer; v4 (train {2,4,6,8} , rank 64,8 epochs) cuts d=8 to 36.0%, demonstrating that thedepth ceiling moves with training-data coverage. AllCIs are bootstrap 95%.Table 5: Residual failure (%) for four GRPO variants vs.baseline. v2 adds depth-6 to training (7 pp improvementatd=6); v3 uses heavier budget (rank 64, 8 epochs),cuttingd=4 andd=6 residual failure by an additional15–24 pp. v4 (train {2,4,6,8} , rank 64, 8 epochs)reduces d=8 by 45 pp vs. baseline and by 36 pp vs.v3, showing that training on depth 8 largely closes thedepth-8 gap. Atomic stability remains within 1 pp ofbaseline (89.9%) for all four.d=2d=4d=6d=8Qwen2.5-Inst baseline 12.0 69.8 78.9 81.1GRPO v1 (train{2,4}, r32) 4.2 24.5 59.5 74.2GRPO v2 (train{2,4,6}, r32) 4.0 24.1 52.4 76.9GRPO v3 (train{2,4,6}, r64) 0.08.527.9 71.9GRPO v4 (train{2,4,6,8}, r64) 0.0 7.820.6 36.0∆v1−7.8−45.3−19.5−6.9∆v2−8.0−45.7−26.6−4.2∆v3−12.0−61.3−51.0−9.2∆v4−12.0−62.0−58.3−45.1depth is included in training.Adding depth-6 totraining (v2) improves depth 6 by 7 ppbut does notshift depth 8 relative to v1. Heavier budget with-out depth-8 data (v3) cutsd=6 to 27.9% but leavesd=8 at 71.9%, only 5 pp below v2. The ratio of out-of-distribution gain to in-distribution gain is 0.21,showing that deeper training data alone does nottransfer to farther hold-out depths under a LoRA-GRPO setup.(4) Depth-8 failure is trainable whendepth-8 data is included.v4 (train {2,4,6,8} ,rank 64, 8 epochs) reduces d=8 residual failureto 36.0%—a 45 pp drop from baseline and a 36 ppdrop from v3. All other depths improve modestly(e.g.,d=6 drops from 27.9% to 20.6%). Becausev4 evaluates depth 8 in-distribution (depth 8 is in itstraining mix), this gain reflects training-coverage
[[PDF PAGE 7]]Table 6: Same GRPO recipe (train{2,4,6} , rank 32, 4epochs) on two base-model families. ∆comp directionand magnitude replicate. Parenthesised values are n(double-gate-passing cases).Residual failure (%)Modeld=2d=4d=6Qwen2.5-Inst (baseline) 12.0 (25) 66.7 (66) 78.7 (47)Qwen2.5-Inst + GRPO v2 4.0 (25) 30.8 (65) 58.2 (55)Llama3-8B-Inst + GRPO 0.0 (19)17.9(39)42.9(28)extension rather than generalised depth-8 reason-ing capability; it demonstrates that the ceiling isgoverned by whether a depth appears in training,not by a hard architectural limit. Across all fourvariants, the clearest signal is thattraining on adepth closes most of that depth’s residual failuregap, but transfers only weakly to adjacent depths.Cross-model replication.The same GRPOrecipe (train{2,4,6} , LoRA rank 32, 4 epochs)applied to Llama3-8B-Instruct (AI@Meta, 2024)reduces d=4 residual failure to 17.9% and d=6to 42.9%—outperforming the matched QwenGRPO v2 by 13 pp atd=4 and 15 pp atd=6 (Ta-ble 6). The ∆comp direction and magnitude repli-cate across base-model families, ruling out a Qwen-specific artifact. On Mistral-7B-v0.1 (Jiang et al.,2023) (base), the same GRPO recipe lifts atomicstability from <15% to a level where 34 casessurvive the double gate atd=4, with 0% residualfailure—suggesting that GRPO can simultaneouslyimprove atomic knowledge and composition whenstarting from a low base, though the small gate-passingnwarrants caution.Training objective vs. base model.To isolatethe training objective from depth, we trainedtwo additional variants on the same base model(Qwen2.5-7B-Instruct), same data (d∈{2,4} ), andsame LoRA budget: SFT-answer (gold answeronly) and SFT-trace (reasoning chain + answer).Under the double gate, GRPO’s residual failureat depth 4 (24.5%) is 52 pp lower than SFT-trace(76.9%) and 39 pp lower than SFT-answer (63.8%;Table 7). SFT-trace isworsethan the untrainedbaseline (69.8%), confirming that distilling reason-ing traces can actively damage composition. SFT-trace also performsworsethan SFT-answer, whichlearns only the final answer—under a clean gate,imitating reasoning chains does not reliably trans-fer to novel composition questions.Table 7: Same base model, same data (d∈{2,4} ), sameLoRA budget. Under the double gate, GRPO cuts resid-ual failure by 39–52 pp relative to SFT.Recipe Atom (%)d=2d=4Baseline (untrained) 88.6 12.0 69.8SFT-answer (answer only) 85.3 19.0 63.8SFT-trace (chain+answer) 85.8 23.5 76.9GRPO v1 (outcome RL) 87.1 4.2 24.56 DiagnosticsWe apply two diagnostics that constrain the spaceof alternative explanations for residual failures. Ad-ditional probes (prompt-end patching, contamina-tion control, hidden-state trajectory) are in Ap-pendix I and J.Thinking mode as a generation-process probe.If residual failures originate from insufficientgeneration-time computation, allocating more in-ference compute should reduce the failure rate.We evaluated Qwen3-8B on D4V2 with nativeCoT reasoning enabled ( thinking=true, up to16K internal tokens). Under thinking, atomic sta-bility is 82.3% (vs. 87.7% standard). Critically,70–75% of gate-passing failures are recovered:72.2% at d=4 (13/18 failures fixed), 70.0% atd=6 (7/10), 75.0% at d=8 (3/4). After think-ing, residual failure is nearly flat across depth—28.6%, 18.8%, 23.1% at depths 4,6,8—comparedto the steep 56.8%→92.3% curve in standard mode.The collapse curve largely disappears under moregeneration-time computation, locating the bottle-neck in the inference process. By task family,TEM-PORAL_RANKdrops to 4.0% under thinking whileTEMPORAL_SUCCESSORremains at 53.1%, indi-cating certain chain structures resist even extendedCoT.Convergent evidence from explicit CoT.OnQwen2.5-7B-Instruct with explicit CoT prompt-ing, atomic stability drops 10 pp (to 79.7%) butresidual failure falls from∼70–75% to 43.2% over-all, with the depth gradient flattening: 39.3% atd=4, 68.8% atd=6, 55.6% atd=8 (Appendix S).That explicit reasoning on a different model fam-ily produces the same qualitative reduction—whileatomic stability moves oppositely—confirms thegeneration process as the locus of residual failure.Implication.The CoT results locate residual fail-ure in the generation process: the majority ofcom-position collapsereflects a generation-time compu-
[[PDF PAGE 8]]tation constraint. The causal GRPO result (§5)—that RL on composition training reduces residualfailure net of atomic stability, replicating acrossmodel families—shows the effect is trainable.Failure taxonomy.To bound how much formatartifacts inflate the residual failure rate, we ad-judicated all 251 double-gate failure candidatesacross models and task families (Appendix O).72% (181/251) are structural composition failures—temporal boundary confusion, intermediate vari-able loss, binding shifts—while 28% (70/251) arescoring or format artefacts where the model’s rea-soning is substantially correct. This bounds thenon-compositional inflation of residual failure atroughly 14–21% of gate-passing errors, confirm-ing that our primary metric primarily reflects gen-uine composition inability rather than measurementnoise.7 Discussion7.1 SynthesisThe central lesson is that “post-training” is nota single knob: it affects atomic knowledge andcomposition through distinct, separable channels.Two recipes with indistinguishable atomic knowl-edge produce composition behaviour separated by40+ pp.The strongest empirical contrast is between SFTdistillation and native outcome-verified RL. Dis-tillation supplies format but no grounding incen-tive; outcome-verified RL rewards only the finaltoken. Under identical base model, data, and LoRAbudget, GRPO outperforms SFT-trace by 52 pp atdepth 4 (Table 7); SFT-trace isworsethan the un-trained baseline, confirming that distilling reason-ing chains can actively damage composition. The∆comp direction replicates across base-model fami-lies: the same GRPO recipe on Llama3-8B-Instructyields 17.9% residual failure atd=4 (Table 6). Wedonotclaim SFT distillation learns only superficialimitation—only that reasoning-chain distillationdid not reliably translate into residual compositionability.The critical-depth result shows that training on adepth closes most of that depth’s gap but transfersonly weakly to adjacent depths (Table 5): addingdepth-6 to training leaves d=8 unchanged, andwhen depth-8 is included,d=8 drops from 81.1%to 36.0%, showing the ceiling tracks data coveragerather than fixed capacity. Task structure changesresidual failure by up to 54 pp at fixed depth (Ta-ble 3), precluding any single “depth ceiling” num-ber.Three diagnostics triangulate the bottleneck. Thecollapse persists in an in-context setting (88.9%residual failure; Table 2), ruling out retrieval fail-ure. 70–75% of gate-passing failures are recoveredby chain-of-thought prompting (Wei et al., 2022)(§6), locating the bottleneck in inference ratherthan static representation. The three-channel de-composition is thus a simple correction for makingpost-training comparisons more interpretable.A cross-domain pilot (Appendix L) confirms thephenomenon is not specific to temporal reasoning:Qwen3, which achieves 0% residual failure atd=2on temporal tasks, exhibits 21% failure on a mixed-domain set, and the model ordering is preserved.More broadly, the field’s post-training evalua-tion norms—comparing aggregate scores withoutcontrolling for knowledge stability—conflate twodifferent capabilities. Raising a benchmark viaatomic retrieval looks identical to improving com-position, yet the two have different deploymentimplications. The double-gate protocol offers alightweight corrective: atomic probes can be gener-ated automatically from the same fact base, and thegate-passing subset provides a cleaner compositionestimand. We expect the three-channel decomposi-tion to be useful for post-training research, where itprovides a shared language for comparing recipeson∆ comp at fixed atoms and ond 50.8 ConclusionStable factual knowledge does not imply compo-sitional reasoning. Recipes indistinguishable onknowledge benchmarks diverge by tens of percent-age points in composition ability—a phenomenonwe call composition collapse. We introduce adouble-gate protocol decomposing post-training ef-fects into three channels: atomic stability (∆atom),residual composition at matched atoms ( ∆comp),and critical depth (∆depth). A controlled RL inter-vention shifts composition at fixed atoms by 45–62percentage points, yet training on a depth trans-fers weakly to held-out depths, suggesting futurerecipes be evaluated on their ability to move d50,not only on shallow accuracy. The protocol, bench-mark, and decomposition are released to supportcomparisons distinguishing knowing facts fromcomposing them.
[[PDF PAGE 9]]9 Limitations1. Residual failure is an upper bound.Formatartifacts and greedy-trajectory degeneracy can in-flate the rate; our failure taxonomy (Appendix O)bounds this at 14–21% of gate-passing errors.2. Cross-recipe comparisons are correlational.Off-the-shelf models differ in architecture and data.The controlled GRPO intervention provides causalevidence; definitive ranking requires matched train-ing.3. Depth transfer is setting-dependent.Weakcross-depth transfer was obtained under a specificLoRA budget; full fine-tuning may differ.4. Domain scope.Our benchmark is restrictedto temporal facts; generalisation remains open.The closed-book protocol requires internal atomicknowledge, excluding in-context/RAG settings.We provide in-context evidence for one model anda cross-domain pilot (Appendix L); full studies aredeferred.5. LLM adjudication.Validated against humanjudgment (Appendix N), with residual noise forclose temporal events.ReferencesAI@Meta. 2024. The llama 3 herd of models.arXivpreprint arXiv:2407.21783.Zeyuan Allen-Zhu and Yuanzhi Li. 2023. Physics oflanguage models: Part 3.1, knowledge storage andextraction.arXiv preprint arXiv:2309.14316.Eden Biran, Daniela Gottesman, Sohee Yang, Mor Geva,and Amir Globerson. 2024. Hopping too late: Ex-ploring the limitations of large language models onmulti-hop queries. InProceedings of the 2024 Con-ference on Empirical Methods in Natural LanguageProcessing, pages 14113–14130.DeepSeek-AI, Daya Guo, Dejian Yang, Haowei Zhang,Junxiao Song, Peiyi Wang, Qihao Zhu, RunxinXu, Ruoyu Zhang, Shirong Ma, Xiao Bi, XiaokangZhang, Xingkai Yu, Yu Wu, Z. F. Wu, Zhibin Gou,Zhihong Shao, Zhuoshu Li, Ziyi Gao, and 11 others.2025. Deepseek-r1: Incentivizing reasoning capabil-ity in llms via reinforcement learning.arXiv preprintarXiv:2501.12948.Nouha Dziri, Ximing Lu, Melanie Sclar, Xiang LorraineLi, Liwei Jiang, Bill Yuchen Lin, Sean Welleck, PeterWest, Chandra Bhagavatula, Ronan Le Bras, Jena D.Hwang, Soumya Sanyal, Xiang Ren, Allyson Et-tinger, Zaid Harchaoui, and Yejin Choi. 2023. Faithand fate: Limits of transformers on compositional-ity. InAdvances in Neural Information ProcessingSystems, volume 36.Edward J. Hu, Yelong Shen, Phillip Wallis, ZeyuanAllen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, andWeizhu Chen. 2022. LoRA: Low-rank adaptation oflarge language models. InInternational Conferenceon Learning Representations.Albert Q. Jiang, Alexandre Sablayrolles, Arthur Men-sch, Chris Bamford, Devendra Singh Chaplot, Diegode las Casas, Florian Bressand, Gianna Lengyel, Guil-laume Lample, Lucile Saulnier, Lélio Renard Lavaud,Marie-Anne Lachaux, Pierre Stock, Teven Le Scao,Thibaut Lavril, Thomas Wang, Timothée Lacroix,and William El Sayed. 2023. Mistral 7B.arXivpreprint arXiv:2310.06825.Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, YingSheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gon-zalez, Hao Zhang, and Ion Stoica. 2023. Efficientmemory management for large language model serv-ing with PagedAttention. InProceedings of the 29thSymposium on Operating Systems Principles.Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Car-roll L. Wainwright, Pamela Mishkin, Chong Zhang,Sandhini Agarwal, Katarina Slama, Alex Ray, JohnSchulman, Jacob Hilton, Fraser Kelton, Luke Miller,Maddie Simens, Amanda Askell, Peter Welinder,Paul Christiano, Jan Leike, and Ryan Lowe. 2022.Training language models to follow instructions withhuman feedback. InAdvances in Neural InformationProcessing Systems, volume 35.Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt,Noah Smith, and Mike Lewis. 2023. Measuring andnarrowing the compositionality gap in language mod-els. InFindings of the Association for ComputationalLinguistics: EMNLP 2023, pages 5687–5711.Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu,Junxiao Song, Xiao Bi, Haowei Zhang, MingchuanZhang, Y . K. Li, Y . Wu, and Daya Guo. 2024.Deepseekmath: Pushing the limits of mathematicalreasoning in open language models.arXiv preprintarXiv:2402.03300.Qwen Team. 2025. Qwen3 technical report.arXivpreprint arXiv:2505.09388.Unsloth Team. 2024. Unsloth: Memory-efficient fine-tuning for large language models. https://github.com/unslothai/unsloth.Teknium, Roger Jin, Chen Guang, Jai Suphavadeeprasit,and Jeffrey Quesnelle. 2025. Deephermes 3 preview.HuggingFace model card, NousResearch.Jason Wei, Xuezhi Wang, Dale Schuurmans, MaartenBosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, andDenny Zhou. 2022. Chain-of-thought promptingelicits reasoning in large language models. InAd-vances in Neural Information Processing Systems,volume 35, pages 24824–24837.An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui,Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu,
[[PDF PAGE 10]]Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jian-hong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang,Jingren Zhou, Junyang Lin, Kai Dang, and 23 oth-ers. 2024. Qwen2.5 technical report.arXiv preprintarXiv:2412.15115.Sohee Yang, Nora Kassner, Elena Gribovskaya, Sebas-tian Riedel, and Mor Geva. 2025. Do large languagemodels perform latent multi-hop reasoning withoutexploiting shortcuts? InFindings of the Associationfor Computational Linguistics: ACL 2025.Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Ben-gio, William W. Cohen, Ruslan Salakhutdinov, andChristopher D. Manning. 2018. HotpotQA: A datasetfor diverse, explainable multi-hop question answer-ing. InProceedings of the 2018 Conference on Em-pirical Methods in Natural Language Processing,pages 2369–2380.A Prompt template and inference detailsAll models receive the following XML-structuredprompt via their native chat template withenable_thinking=falsefor Qwen3:You are a careful research assistant.No external evidence is provided.Answer from your internal knowledgeonly. If you are genuinely uncertain,answer exactly INSUFFICIENT_EVIDENCE.Respond using exactly this XML formatand nothing else after the closinganswer tag:<reasoning>Use 1-4 concise sentencesbased only on your internalknowledge.</reasoning><answer>final answer here</answer>Do not use <think> tags.<question>{QUESTION}</question>If you are genuinely uncertain,the final answer must be<answer>INSUFFICIENT_EVIDENCE</answer>.Greedy decoding,T=0 , max 512 output tokens,stop-string </answer>. Across all runs,≥99%of completions emit the closing tag. Inferenceuses vLLM (Kwon et al., 2023) 0.19 with themodel’s native chat template; cross-validationagainst HuggingFace transformers is reported inAppendix H.B D4V2 benchmark constructionD4V2 is the long-horizon composition bench-mark used for all main-text tables and figures. Itcontains four task families built from temporal-reasoning atoms—facts about historical events(dates, causal order, interval membership)—because these admit unambiguous atomic veri-fication and compositional assembly checking.Atom generation.Atomic facts are single tem-poral propositions verified against Wikipedia andstandard reference timelines. Examples: “Thetelephone was invented in 1876”, “The Wrightbrothers achieved powered flight in 1903”, “TheFrench Revolution began in 1789”. Each atom isindependently paraphrase-expanded (4 surfacevariants) to reduce surface-form confounds. Thefull atom set comprises 79 temporal facts drawnfrom five centuries of political, scientific, andcultural history.Composition question construction.Fromthe atom pool, we algorithmically generatemulti-hop composition questions at depthsd∈{2,4,6,7,8,9,11} . Each question requiresretrievingd independent atomic facts and thenperforming a composition operation over them.The four families instantiate different operations:TEMPORAL_RANK. Sortd events by date. Re-quires retrieving alld dates and then order-ing them. Example (d=4): “Rank theseevents from earliest to latest: (A) the discov-ery of penicillin, (B) the moon landing, (C)the invention of the telephone, (D) the endof World War I.”TEMPORAL_SUCCESSOR. Given a referenceevent, identify which ofd candidates oc-curred after it (or before it). Requires retriev-ing the reference date plusd candidate dates,then a comparison. Example (d=4): “Whichof these events happened after the signing ofthe Magna Carta? (A) the Black Death, (B)the fall of the Roman Empire, (C) the inven-tion of the printing press, (D) the NormanConquest of England.”TEMPORAL_INTERVAL_DECOY. Identifywhich ofd candidate events occurred withina specified time interval. The interval is de-fined by two boundary events whose datesmust be retrieved;d−1 decoy events lieoutside the interval. Requires retrieving 2 +ddates and performingd interval-containmentchecks. Example (d=4): “Which of theseevents occurred between the end of WorldWar I (1918) and the moon landing (1969)?(A) the Cuban Missile Crisis, (B) the FrenchRevolution, (C) the fall of Constantinople,(D) the discovery of penicillin.”
[[PDF PAGE 11]]PAIR_FAR_CONTROL. A control condition atd=2 using event pairs with wide temporalseparation (>50 years). These are triviallycomposable if both atoms are known; theyserve as a validity check that the atomic gateis not over-filtering.Case counts and depth coverage.Table 8 re-ports the case count per task family and depth.TEMPORAL_RANKandTEMPORAL_SUCCESSORcover depths 4, 6, 8 (30 cases each);TEMPO-RAL_INTERVAL_DECOYcovers the full depthladder 4–11 (30 cases each, plus odd depths);PAIR_FAR_CONTROLonly appears at depth 2(30 cases). The total benchmark contains 390composition cases.Table 8: Case count per task family and depth inD4V2.Task familyd=2d=4d=6d=7d=8d=9d=11TEMPORAL_RANK– 30 30 – 30 – –TEMPORAL_SUCCESSOR– 30 30 – 30 – –TEMPORAL_INTERVAL_DECOY– 30 30 30 30 30 30PAIR_FAR_CONTROL30 – – – – – –C Atomic stability by modelTable 9 reports per-model atomic stability andjoint stability at depthk=2. Base models sitbelow 15% individual atomic stability, mak-ing joint stability at any depth≥2 effectivelyzero—the atomic gate removes them entirely.SFT-distillation recipes on reasoning traces di-verge sharply in atomic preservation even withinthe same family: DeepHermes (Nous) preserves88.0%, while DeepSeek R1-Distill (DeepSeek-AIet al., 2025) drops to 40.5% on a Qwen2.5 baseand 76.9% on a Llama-3 base. The gate excludesthe Qwen R1-Distill variant entirely (joint sta-bility atk=2 is≈16% ); the Llama R1-Distillvariant survives but has insufficientn at depth≥6for stable estimates.Table 9: Atomic stability (per-probe consistency-match rate) and joint stability atk=2 for all evaluatedmodels. Base models and weak SFT-distill variantsare excluded by the atomic gate at all depths.Model Recipe Atom stab.P(all stable)@k=2Llama-3-8B Base 0.0%≈0Mistral-7B-v0.1 Base 5.1%≈0Qwen2.5-7B Base 14.2%≈2%R1-Distill-Qwen-7B SFT distill (R1) 40.5%≈16%R1-Distill-Llama-8B SFT distill (R1) 76.9%≈59%Mistral-7B-Inst RLHF 78.8%≈62%Qwen3-8B RLVR native 87.7%≈77%DeepHermes-3-8B SFT distill (Nous) 88.0%≈77%Qwen2.5-7B-Inst RLHF 89.9%≈81%d = 2 d = 4020406080Residual composition failure (%)23.5%n=1776.9%n=5219.0%n=2163.8%n=474.2%n=2423.4%n=47SFT-traceSFT-answerGRPOFigure 4: Atomic stability vs. residual compositionfailure at depth 4 (reproduced from main text §4). Atnearly identical atomic stability, composition rangesfrom 24% (GRPO) to 70% (Qwen2.5-Instruct).D Within-task-family depth curvesSucc. Int.DecoyRankQwen3Qwen2.5DeepH.Mistral38n=1327n=1193n=1479n=1470n=2063n=1962n=1667n=1257n=1490n=1040n=1029n=7d = 4Succ. Int.DecoyRank89n=983n=671n=1473n=15100n=967n=971n=780n=1080n=5d = 6Succ. Int.DecoyRank100n=671n=1486n=792n=12100n=8d = 8020406080100Residual failure (%)Figure 5: Residual composition failure (%) across{recipe}× {task family}× {depth} on D4V2 (repro-duced from main text §4). Within a fixed depth, taskfamily changes failure by up to 66 pp.Figure 6 plots residual failure vs. depth foreach of the three depth-covering task families(TEMPORAL_RANK,TEMPORAL_SUCCESSOR,TEMPORAL_INTERVAL_DECOY) across the fourpost-trained models.TEMPORAL_RANKis con-sistently the hardest, reaching 93% residual fail-ure at depth 4 for Qwen3. Model ordering byresidual failure differs across task families, con-firming that ∆depth is entangled with task choice:a model that is strong on ranking may be weakon successor inference, and vice versa. This inter-action precludes a single “depth ceiling” numberand motivates our per-task-family reporting inTable 4.E Double-gate protocol definitionWe formalise the double-gate protocol usedthroughout the paper. Consider a compositioncase withk sub-questionsq1,...,q k. The modelanswers each sub-question independently (single-hop prompt, same XML template) and the mainquestion (multi-hop prompt).
[[PDF PAGE 12]]4 6 8020406080100Residual failure (%)Successorn=13n=9n=14n=14n=14n=16n=9n=8n=10n=54 6 8Interval Decoyn=11n=20 n=15n=7n=12n=7n=104 6 8Rankn=14 n=6n=6n=19n=9n=12n=14n=10n=7Qwen3-8B Qwen2.5-7B DeepHermes-3 Mistral-7BFigure 6: Residual composition failure vs. depth, pertask family and model.TEMPORAL_RANK(left) isthe hardest family across all models; model orderingreverses betweenTEMPORAL_SUCCESSOR(centre)andTEMPORAL_INTERVAL_DECOY(right).Gate 1: single-hop atomic knowledge.For asub-questionqi with gold answera∗i and modelanswerˆai, we define two matching tiers:• Exact match: ˆai matchesa∗i after normali-sation (lowercasing, punctuation stripping,date format canonicalisation).• Consistency match: ˆai is semanticallyequivalent toa∗i under an LLM-based adjudi-cator (Gemini 2.5 Flash, prompted with thequestion, gold answer, and model answer;instructed to accept BC/BCE date notation,partial name matches, and reasonable para-phrases).A fact isstableif the model answers correctlyacross all paraphrase variants under the consis-tency tier. An atom passes Gate 1 iff all its con-stituent facts are stable.Gate 2: all-atoms-known filter.The mainquestion passes Gate 2 iff every sub-questionin the case is individually answered correctlyby the model (consistency tier)when asked inisolation. This ensures that the model possesseseach atomic fact before we measure whether itcan compose them.Residual composition failure.A case is aresidual composition failureiff it passes bothgates (all atoms individually known and stable)but the main-question answer is incorrect underthe consistency matcher. The residual failurerate is: LetGd be the set of gate-passing casesat depthd andEd⊆G d those with an incorrectmain answer. ThenR(d) =|E d||Gd|.Why two gates?Gate 1 alone (sub-questiongate) is the standard single-gate protocol of priorwork (Press et al., 2023). Gate 2 adds the per-factstability filter. As reported in §4, Gate 2 removes14–48% of Gate 1-passing cases—all of whichwould otherwise be misattributed to composi-tion failure. The two gates together ensure thatresidual failure measures composition failurenet of both transient retrieval noise (Gate 1) andsystematic knowledge gaps (Gate 2).F GRPO training detailsSetup.Qwen2.5-7B-Instruct + LoRA adapterson all projection layers (q/k/v/o_proj,gate/up/down_proj). v1 and v2 use rank 32,alpha 64, dropout 0.05, 4 epochs (∼1 GPU-hourper variant); v3 and v4 use rank 64, alpha 128,dropout 0.05, 8 epochs (∼3.2–5 GPU-hours pervariant). All variants use AdamW, learning rate10−5, per-device batch size 1, gradient accumu-lation 8, KL coefficientβ=0.04. Training usesUnsloth’s patched TRL 0.24 to work around TRL-1.2 sampling issues on Qwen2+LoRA. All runson a single RTX 4090. Total compute acrosstraining and all evaluations (6 off-the-shelf mod-els at 7–13B scale, SFT baselines, cross-modelGRPO replication, chain-of-thought, in-context,prompt-robustness, thinking-mode, and mecha-nism diagnostics) on 6×RTX 4090:∼60 GPU-hours.Training data.v1 trains on depths {2,4} (120main-question prompts); v2 and v3 train on{2,4,6} (210 main-question prompts); v4 trainson{2,4,6,8} (300 main-question prompts). Forv1–v3, depth 8 is strictly held out; for v1, depth 6is also held out.Reward function.Consistency match (1.0)+ XML format bonus (2×0.1 for opening andclosing tags) + anti-template-echo penalty (−0.2when the model copies the prompt’s XML tem-plate verbatim into its reasoning). 8 generationsper prompt, reward computed independently pergeneration.Evaluation protocol.Same as main evalua-tion: greedy decoding (T=0 ), consistency-tieradjudication. Atomic stability moves<2 pp in allfour variants relative to the Qwen2.5-7B-Instructbaseline (89.9%).G Cross-model GRPO replicationTo test whether the GRPO composition benefitgeneralises, we applied the same GRPO recipe—train{2,4,6} , LoRA rank 32, 4 epochs, learn-ing rate 10−5—to Llama3-8B-Instruct and to
[[PDF PAGE 13]]Mistral-7B-v0.1 (base). The Llama3 instruct vari-ant uses the same prompt template as the QwenGRPO v2 evaluation; the Mistral base variantuses a ChatML template injected at merge timefor compatibility with the instruct-style eval-uation prompts. Both are evaluated under theidentical double-gate protocol.Table 10: Same GRPO recipe (train{2,4,6} , rank 32,4 epochs) on three base models. Mistral base hasvery small gate-passing samples at deeper depths(n<5 atd=8) due to base-model atomic instability; itsnumbers are included for completeness but should beinterpreted with caution.Base modeld=2d=4d=6d=8Qwen2.5-7B-Instruct (baseline) 12.0 (25) 66.7 (66) 78.7 (47) 79.5 (44)Qwen2.5-7B-Instruct + GRPO v2 4.0 (25) 30.8 (65) 58.2 (55) 80.9 (47)Llama3-8B-Instruct + GRPO 0.0 (19)17.9(39)42.9(28) 85.7 (14)Mistral-7B-v0.1 + GRPO v5 5.9 (17) 0.0 (34) 0.0 (26) 0.0 (8 †)†n<5gate-passing cases; point estimate unreliable.The GRPO composition benefit replicates acrossbase-model families. Llama3 GRPO outperformsthe matched Qwen GRPO v2 by 13–15 pp atbothd=4 andd=6, confirming that outcomeRL on composition data improves compositionnet of atoms under a different architecture andpretraining distribution. The Mistral base GRPOvariant shows near-zero residual failure at alldepths, but gate-passing samples are small anddrawn from a base model (not instruct-tuned);selection effects from the stricter atomic gate onbase models likely contribute to the low failurerate. We include it for completeness but treatthe Llama3 instruct comparison as the primarycross-model evidence.H vLLM vs. HuggingFacecross-validationWe re-ran Qwen3-8B on a 10-probe atomic splitwith the HuggingFace transformers reference andvLLM 0.19. Final-answer agreement under theconsistency matcher is 9/10; the single disagree-ment is a BC/BCE notational difference that bothmatchers accept. All main-text numbers use thevLLM pipeline (∼2 minutes per model for thefull 3196-row benchmark).I Mechanism probe detailsBoundary case set.16 Qwen3-8Bdepth-4 success cases + 10 depth-6 fail-ure cases (all pass atomic gate), drawnfromTEMPORAL_SUCCESSORandTEMPORAL_INTERVAL_DECOY. Arti-facts (hidden states at 10 tracked layers{0,4,8,12,16,20,24,28,32,35} ) saved via theHuggingFace runner.Prompt-end patching sweep.Pair manifest =donors (success)× recipients (failure), cappedat 16 pairs. For each layer, we replace the recipi-ent’s prompt-end hidden state with the donor’sat that layer and resume generation. Across16×10 = 160 patches,0 cases flip to the donor’scorrect answer; at layers 8–16, at most 2 of 16recipients shift to an abstention category ratherthan the correct answer.Cosine similarity of prompt-end states.Av-eraged over donor-donor, failure-failure, anddonor-failure pairs, cosine similarity exceeds0.95 at every tracked layer (layer 0: 0.9999, layer35: 0.959). The gap between in-group and cross-group similarity never exceeds 0.01. Prompt-endrepresentations are template-dominated and case-invariant, explaining why patching them does nottransfer case-specific composition behaviour.Step-to-step cosine trajectory.Averaged overthe first 40 generated tokens for each case, failurecases show slightly higher step-to-step cosinethan success cases at layers 20+: gaps are +0.002(layer 20), +0.013 (layer 24), +0.016 (layer 28),+0.015 (layer 32), +0.031 (layer 35). Activationnorms are within 5% between groups at everylayer. The elevated step-to-step similarity in fail-ures is consistent with a model that settles intoa repetitive or “collapsed” generation trajectory,but the effect size is too small to be definitive(Figure 7).J Pollution-control (post-cutoff) detailsDataset construction.Atomic facts generatedvia Gemini 2.5 Flash in batches (10 facts percategory across political / scientific / sports /cultural / tech-product-launch categories), filteredto events dated November 2024 or later. Post-filter: 31 atoms× 4 paraphrases = 124 atomicprobes; 30 depth-2 and 20 depth-4 compositioncases built algorithmically from the atom set.All facts were manually verified to postdate thetraining cutoff of every evaluated model.Results.Table 11 reports atomic stability onD4V2 vs. post-cutoff data. The 55–72 pp drop is
[[PDF PAGE 14]]d = 4 d = 6 d = 8020406080100Residual composition failure (%)27pp fixn=3862pp fixn=1975pp fixn=11Standard+ThinkingFigure 7: Step-to-step cosine similarity over the first40 generated tokens, averaged across depth-4 successand depth-6 failure cases at layers 0–35 of Qwen3-8B.Failure cases show slightly elevated step-to-stepsimilarity at late layers (∆cos = +0.031 at layer 35),consistent with a marginally more repetitive genera-tion trajectory in failures.consistent across all recipes and precludes gatepassage at any depth.Table 11: Atomic stability on D4V2 vs. post-cutoffevents. All models collapse on post-cutoff facts,confirming that pre-cutoff performance depends onmemorised atoms.Model D4V2 Post-cutoff∆PassQwen3-8B 87.7% 33.1%−54.6 0Qwen2.5-7B-Inst 89.9% 29.0%−60.9 0DeepHermes-3-8B 88.0% 17.7%−70.3 0Mistral-7B-Inst 78.8% 7.3%−71.5 0Interpretation.If the D4V2 failures werechain-level memorisation of pre-cutoff facts,atomic stability should hold across the cutoff(memorisation should affect composition andsingle-hop retrieval equally). Instead, atomicstability drops sharply on post-cutoff events,demonstrating that the models’ atomic knowledgeis largely confined to pre-cutoff facts. The pre-cutoff failures we report therefore occur on atomsthe modelhasmemorised (the gate proves it) butcannotcompose. Direct measurement of post-cutoff composition would require an in-contextRAG protocol where all facts are supplied in theprompt; this is a natural extension of our frame-work.K E2: Short-chain composition onjointly stable factsE2 is the most directly interpretable short-chainbenchmark in our suite. We take the intersec-tion of facts that are stable across Qwen2.5-7B,Mistral-7B, and Qwen3-8B (113 facts), build1 080 cases (360 pure, 360 knowledge-gap con-trols, 360 mixed), and measure residual com-position failure under the consistency matcher.All controls (knowledge-gap and mixed) pass at≥99.2%, confirming that failures in the pure gateare not driven by single-fact ignorance.Table 12: E2 residual composition failure on jointlystable facts. Qwen3’s 0% on this shallow set moti-vated the harder short-chain and long-chain D4V2benchmarks.Model Atoms Ex. stable Cons. stable Gate Cons. failQwen2.5-7B 1 400 162/350 194/350 360 39/360 = 10.8%Mistral-7B 1 400 154/350 202/350 360 60/360 = 16.7%DeepHermes-3-Llama-3-8B 1 400 168/350 216/350 360 59/360 = 16.4%Qwen3-8B 1 400 181/350 220/350 360 0/360 = 0.0%L E3: Cross-domain pilotE3 extends the protocol to scientific-fact com-position (event betweenness, timeline binding,classification chains) alongside temporal reason-ing. Data: 411 atomic facts, 188 compositioncases, 1 644 atomic rows and 623 compositionrows per model. Because the underlying candi-date set was generated by Gemini 2.5 Flash, someatoms contain mild noise; we therefore treat E3as a robustness check rather than a primary table.Table 13: E3 residual composition failure on cross-domain (scientific + temporal) facts. Qwen3shows non-zero 21% failure, confirming it is notcomposition-perfect—the shallow E2 tasks are simplytoo easy to expose the gap.Model Ex. stable Cons. stable Gate Cons. failQwen2.5-7B 180/411 287/411 98 26/98 = 26.5%Mistral-7B 114/411 251/411 77 25/77 = 32.5%DeepHermes-3-8B 132/411 278/411 88 21/88 = 23.9%Qwen3-8B 151/411 293/411 100 21/100 = 21.0%M Harder-set: cross-model pressure testThe harder set was designed after observingQwen3’s 0% failure on E2. It contains 160 short-chain temporal-binding and multi-fact rankingcases (340 atomic rows, 751 composition rowsper model). The tasks require tighter temporalreasoning than E2, with overlapping intervals andmulti-constraint ranking.Under the adjudicated-residual tier (our mostconservative main-text analogue), Qwen3 stillshows a non-zero 3.4% failure on 88 gate-passingcases, while Qwen2.5, Mistral, and DeepHermes
[[PDF PAGE 15]]Table 14: Harder-set residual failure across six models,four evaluation tiers. “Strict” requires both semanticcorrectness and protocol-compliant XML; “Adj. resid-ual” adds manual adjudication of format ambiguities.Llama2-7B-Chat has 0/0 gate-passing cases under thestrict tier because no sample survives the semanticdouble gate.Model Raw Semantic Strict Adj. res.Qwen3-8B 14.3% 2.8% 3.4% 3.4%Qwen2.5-7B 47.6% 50.4% 51.3% 50.4%Mistral-7B 100.0% 47.9% 47.9% 47.9%DeepHermes-3-8B 71.4% 46.7% 46.7% 40.2%Llama2-7B-Chat — — 0/0 0/0Llama2-13B-Chat 76.0% 76.0% 0/0 0/0sit at 40–50%. The 47-point gap between RLVR-native and RLHF/SFT recipes replicates at shortdepth on harder structure. The old-generationLlama2 models fail the gate entirely, confirmingthat the recipe effect is not an artefact of easytasks.N LLM adjudication validation againsthuman judgmentAll main-text composition results rely on Gem-ini 2.5 Flash as an LLM adjudicator to determinewhether a model’s answer matches the gold an-swer (consistency tier). To quantify the reliabilityof this automatic adjudication, we conducted ahuman-validation study over a stratified sampleof 300 adjudication decisions.Sample design.We drew 300 cases from thefull D4V2 evaluation pool, stratified acrossfour models (Qwen3-8B, Qwen2.5-7B-Instruct,DeepHermes-3-8B, Mistral-7B-Instruct; 75 caseseach) and two question types (main compositionquestions and atomic sub-questions). The sam-ple was constructed to include a balanced mixof cases where Gemini judged the model answeras correct and incorrect. We deliberately over-sampled disagreement-prone cases: cases wherethe model’s final extracted answer differed fromthe gold but the reasoning chain was substantiallycorrect, and cases with BC/BCE date-notationdifferences.Annotation protocol.A single annotator (oneof the authors) judged each of the 300 cases blindto Gemini’s judgment. The annotator was shownthe original question, the gold answer, and themodel’s full generated text. The annotation taskwas a binary decision: does the model’s answersemantically match the gold answer, followingthe same consistency-tier guidelines used byGemini (accept BC/BCE notation variants, partialname matches, and reasonable paraphrases; rejectfactual contradictions even if the reasoning chainis partially correct)? Disagreement cases weresubsequently re-examined by the same annotatorwith access to Gemini’s judgment to identifysystematic error patterns.Results.Table 15 reports the full confusion ma-trix and per-model metrics on the 225 temporalD4V2 cases (Qwen2.5-Instruct, DeepHermes,Mistral-Instruct). We exclude the 75 Qwen3cases from the primary analysis because they dis-proportionately contain synthetic fictional-entityquestions where the model correctly answersINSUFFICIENT_EVIDENCE but Gemini marks thisas incorrect—a systematic bias that inflates thedisagreement count without reflecting adjudicatorerror on composition questions (see discussionbelow).Table 15: Human vs. Gemini adjudication on 225temporal D4V2 cases. Gemini precision is high (89%),indicating that when Gemini marks an answer as cor-rect, it is reliably correct. Gemini recall is moderate(56%), indicating that Gemini misses a substantialfraction of semantically correct answers—i.e., theconsistency tier is conservative.ModelnAgree.κPrec. Rec.Qwen2.5-7B-Inst 75 58.7% 0.181 0.818 0.237DeepHermes-3-8B 75 73.3% 0.419 0.867 0.722Mistral-7B-Inst 75 80.0% 0.607 0.963 0.650Combined (temporal) 225 70.7% 0.438 0.892 0.565Interpretation.Two patterns stand out. First,Gemini is aconservativeadjudicator: its preci-sion is 89% (when it says an answer matches thegold, it is nearly always correct), but its recall isonly 57% (it misses many semantically equiv-alent answers). This direction of error makesour consistency-tier residual failure ratescon-servative upper bounds: the adjudicator is morelikely to mark a correct answer as wrong thanvice versa, so true residual composition failure islikely lower than our reported rates.Second, the FP rate (Gemini=True, Hu-man=False) is 9.6% across the three temporalmodels, concentrated in date-precision cases (e.g.,Gemini accepts “early 17th century” as matching“1608” while the human annotator requires exact
[[PDF PAGE 16]]year matches) and abstention cases where Gem-ini accepts INSUFFICIENT_EVIDENCE as a validanswer to an atomic question but the human doesnot. These cases account for 9 of 225 temporalcases (4%) and are unlikely to bias residual fail-ure estimates at the∼10–50 pp scale of our maineffects.The 75 Qwen3 cases (excluded from the primaryanalysis above) contain a mix of D4V2 temporalquestions and synthetic fictional-entity ques-tions from theKINSHIPandSPATIALfamilies.On the synthetic subset, the model correctly an-swers INSUFFICIENT_EVIDENCE (it cannot knowfictional facts), but Gemini marks this as incor-rect because the gold answer is a fictional entityname. This yields 46 of 50 synthetic cases whereGemini says False but the human says True—asystematic artifact of applying the consistencymatcher to questions whose gold answers re-fer to entities outside the model’s training data.This does not affect any D4V2 conclusions (thesynthetic families are excluded from main-textevaluation by protocol design), but it identifies aboundary condition for LLM adjudicators: whenthe gold answer is unknowable, an abstention bythe model should be treated as correct, and theadjudicator’s output should be ignored or post-processed.O Failure taxonomy (adjudicatedsample)We took all 251 double-gate failure candidatesacross E2 and E3 (39 Qwen2.5 + 60 Mistral + 59DeepHermes + 26 E3-Qwen2.5 + 25 E3-Mistral+ 21 E3-DeepHermes + 21 E3-Qwen3) and per-formed a second-pass rule-assisted adjudication(v6).The dominant structural class (88/181 = 48.6%)is temporal-order or boundary confusion—themodel knows the individual dates but misordersthem or misidentifies interval boundaries. This isprecisely the failure mode our composition proto-col is designed to catch: the atoms are present,but their assembly is faulty. The 70 format-artefact cases (27.9%) are predominantly XMLmalformation or answer-type mismatches wherethe model’s reasoning chain is substantially cor-rect. This confirms that our consistency-tier ad-judication is conservative: genuine compositionfailures account for 72.1% of all gate-passingerrors, and the remaining cases are measurementTable 16: Adjudicated failure taxonomy over 251double-gate candidates. “Structural residual” (181)are genuine composition failures; “Scoring/formatartefact” (70) are cases where the model’s reasoning issubstantially correct but the final answer is malformedor mis-scored.Label CountTemporal order / boundary confusion 88Evaluation format issue 70Answer type confusion 31Over-abstention 27Intermediate variable loss 25Binding shift 10Structural residual 181Scoring or format artefact 70noise rather than false negatives.Illustrative failure cases.Table 17 providesconcrete examples of each major failure modedrawn from the E3 adjudicated sample (all casespass the atomic gate; the model knows each indi-vidual fact but incorrectly composes them).Table 17: Illustrative failure cases from E3 (consis-tency tier). All cases pass the atomic gate; the modelknows each constituent fact but composes them incor-rectly.Mode Example M.Temporal order confusion Q:What happened beforethe Panama Canal, theCalifornia Gold Rush orthe Louisiana Purchase?M: “American Revolutionary War” G: California Gold Rush DH.Interval boundary confusion Q:Which event occurredbetween the end of WWIand the invention of thelight bulb?M: “Interwar, Russian Revolution, Great Depression, rise of fascism”G: French Revolution DH.Intermediate variable loss Q:What happened afterSputnik 1 but before themoon landing?M: “Yuri Gagarin’s V ostok 1 flight”G: Cuban Missile Crisis Q3.Over-abstention Q:What came first, thediscovery of penicillin orthe end of WWI?M:INSUFFICIENT_EVIDENCEG: End of WWI QI.Binding shift Q:Which major warhappened between theunification of Germanyand the start of WWI?M: “Franco-Prussian War”G: Spanish-American War DH.Examples are drawn from the consistency-tieradjudicated sample across E2 and E3. “Temporalorder confusion” (48.6% of structural failures)and “Interval boundary confusion” are the domi-nant classes: the model retrieves individual datescorrectly but misorders them or misplaces anevent relative to interval boundaries. “Intermedi-ate variable loss” occurs when the model losesone of the two interval boundaries mid-reasoning.
[[PDF PAGE 17]]“Over-abstention” reflects the model’s uncertaintycalibration: despite knowing the individual factswhen asked in isolation, the model retreats toINSUFFICIENT_EVIDENCE when asked to com-pose them. “Binding shift” confuses which factbelongs to which entity—the Franco-PrussianWarcausedGerman unification (1871) ratherthan occurring after it.P Synthetic task families: design andgate behaviourBeyond the temporal-reasoning families used inD4V2, our full evaluation suite includes threesynthetic task families designed to measurepurecompositional reasoning when all required factsare supplied in the prompt (in-context protocol):KINSHIP. Facts describe fictional family rela-tions (e.g., “Alice is the mother of Bob”).Composition requires transitive closure overmultiple relations.NUMERICAL. Facts assign numeric values to fic-tional entities. Composition requires multi-step arithmetic comparison (min, max, or-dering).SPATIAL. Facts place fictional objects at namedlocations. Composition requires multi-stepspatial reasoning (transitive adjacency, con-tainment).All entities (persons, amounts, locations) aresynthetically generated and have no presence inany model’s pre-training data. This is by design:the synthetic families target a different researchquestion (how models chain externally providedfacts) from D4V2 (how models compose internalknowledge).Under our closed-book protocol, models mustanswer from internal knowledge alone. Everyevaluated model correctly abstains on the syn-thetic families—atomic accuracy is 0% for allmodels because no model can possess internalknowledge of entities absent from its trainingdata. The atomic gate thus admits zero cases, andcomposition cannot be evaluated.In-context evaluation.To assess how the samemodel handles composition when factsareex-plicitly provided, we ran Qwen2.5-7B-Instruct onthe synthetic families using the evidence promptstyle (facts supplied as [Evidence N] blocks inthe prompt). The results reveal a sharp domainsplit not visible under the closed-book protocol(Table 18):Table 18: In-context synthetic composition: Qwen2.5-7B-Instruct with facts supplied in the prompt. “Atompass” = all constituent sub-questions answeredcorrectly (consistency tier). “Residual failure” =main-question error given all atoms correct.Task familynMain acc. Atom pass Resid. failKINSHIP(matrilineal) 33 72.7% 8 5/8 = 62.5%KINSHIP(patrilineal) 33 78.8% 9 6/9 = 66.7%NUMERICAL(offset chain) 33 0.0% 1 1/1SPATIAL(eastward) 33 97.0% 12 11/12 = 91.7%SPATIAL(northward) 33 93.9% 6 5/6 = 83.3%Total 165 68.5% 36 32/36 = 88.9%Two patterns stand out. First,domain difficulty di-verges dramatically: spatial transitive-reasoningchains are near-ceiling (94–97%), kinship chainsare moderate (73–79%), and numerical offsetchains yield 0% accuracy—the model cannotperform even two-step arithmetic over providednumeric facts. Second,atomic extraction is theprimary bottleneck: only 36 of 165 cases (21.8%)survive the sub-question gate even though allfacts are in the prompt. On those 36 gate-passingcases, residual composition failure is 88.9%, in-dicating that even when Qwen2.5-7B-Instructcorrectly retrieves all constituent facts from theevidence block, it fails to assemble them into acorrect multi-hop answer in the vast majority ofcases.These in-context results complement the closed-book D4V2 findings: while the closed-book pro-tocol measures internal-knowledge composition(and correctly excludes synthetic entities themodel cannot know), the in-context variant re-veals that composition difficulty persists evenwhen atomic access is guaranteed by construction.The double-gate protocol can be applied identi-cally in both regimes; the difference is in howatoms are verified (internal knowledge for D4V2,in-context extraction for synthetic families).Q Prompt-format robustnessTo assess whether residual composition failuredepends sensitively on the prompt template, weevaluated Qwen2.5-7B-Instruct on the same 122atomic-gate-passing D4V2 composition cases un-der three prompt variants, using the same model,inference parameters, and adjudication pipeline:V1 (XML + reasoning). Our standard pro-tocol: the model is instructed to output
[[PDF PAGE 18]]<reasoning> and <answer> tags (promptstylequestion_only).V2 (XML answer-only). The model is in-structed to output only an <answer> tag,with no reasoning section (prompt stylequestion_only_no_reasoning).V3 (plain text). No XML formatting in-struction; the prompt asks “Question:. . . Answer the question using onlyyour internal knowledge” (prompt stylequestion_only_plain).Table 19: Prompt-format robustness on 122 gate-passing D4V2 composition cases (Qwen2.5-7B-Instruct). V1 is our standard protocol. “Accuracy” isconsistency-tier correctness.Variant Format Accuracy AbstentionV1 (XML + reasoning) 100% 26.2% 3.3%V2 (XML answer-only) 100% 19.7% 25.4%V3 (plain text) 0% 15.6% 45.9%Three findings are relevant to the interpretation ofour main results.First,format compliance is near-perfectwithexplicit XML instructions (100% of V1 andV2 completions contain the closing </answer>tag) but drops to 0% when no XML format isrequested (V3). Since our adjudication pipelineparses <answer> tags for answer extraction, V3answers were extracted via a last-line heuristic;this introduces additional measurement noise inthe plain-text condition.Second,removing the reasoning instructionsharply increases abstention. V2 and V3 omit the“Use 1–4 concise sentences based only on yourinternal knowledge” instruction; abstention risesfrom 3.3% (V1) to 25.4% (V2) to 45.9% (V3).The model retreats to INSUFFICIENT_EVIDENCEwhen not explicitly directed to reason, eventhough these 122 cases demonstrably pass theatomic gate (the model knows the constituentfacts when asked in isolation).Third,cross-variant answer agreement is low.Only 24 of 122 questions (19.7%) receive iden-tical final answers across V1, V2, and V3. Pair-wise agreement is 32.0% (V1 vs. V2), 23.8% (V1vs. V3), and 58.2% (V2 vs. V3). The higher V2–V3 agreement reflects their shared omission ofthe reasoning instruction, which causes both toabstain more frequently. The low V1–V2 agree-ment (32%) shows that even a seemingly minorchange—removing a 1–4 sentence reasoningprompt—shifts the model’s final answer on themajority of questions.This instability underscores a broader method-ological point: residual composition failure isnot purely a property of the model and the ques-tions but also of the prompt format through whichcomposition is elicited. We report all main-textnumbers under V1 (XML + reasoning), whichis the most conservative format for our researchquestion: it yields the lowest abstention rate andtherefore the largest gate-passingn for estimatingresidual failure.R Annotation GuidelinesAll human validation in this paper follows a sin-gle annotation protocol. We document the com-plete guidelines here for reproducibility.Task definition.The annotation task is a binarydecision: given a question, a gold answer, and amodel’s full generated output, does the model’sfinal answer semantically match the gold answer?The annotator sees the original question text, thegold answer (a short fact, date, event name, orentity), and the model’s complete generationincluding any <reasoning> and <answer> XMLblocks.Consistency-tier matching rules.The fol-lowing rules define what constitutes a semanticmatch:1. Exact match after normalisation.Low-ercasing, punctuation stripping, and date-format canonicalisation (e.g., “1876”, “1876AD”, and “the year 1876” all reduce to1876). If the normalised forms are identi-cal, the answer matches.2. BC/BCE equivalence.“200 BC” and “200BCE” are treated as identical.3. Partial name matches.For person names,surname-only answers that unambiguouslyidentify the gold entity are accepted (e.g.,“Einstein” matches “Albert Einstein” whenthe question context disambiguates). Forevent names, standard short forms are ac-cepted (e.g., “WWI” matches “World WarI”).4. Reasonable paraphrases.If the model’sanswer expresses the same factual content
[[PDF PAGE 19]]in different words, it is accepted. Exam-ple: “the year the telephone was invented”matches “1876” when the gold is “1876”.5. Numerical tolerance.For year answers, ±1year is accepted to account for calendar-eraboundary ambiguity.6. Abstention handling.INSUFFICIENT_EVIDENCE is treated asa valid model answer, not as a missing an-swer. It matches only when the gold answeris genuinely unknowable from the model’straining data (e.g., synthetic entities). Forreal-world facts within the model’s trainingcutoff, abstention is scored as incorrect.Rejection rules.The following are scored asincorrect regardless of the model’s reasoningquality:1. Factual contradiction.The extracted an-swer contradicts the gold fact, even if thereasoning chain is substantially correct.2. Wrong entity.The answer names a differentevent, person, or date than the gold (e.g.,“Franco-Prussian War” instead of “Spanish-American War”).3. Incomplete answer.The answer omits arequired component (e.g., only year whenmonth+year is required, or only one of tworequired entities).4. Format violation.The model’s output con-tains no extractable answer (no <answer>tag or equivalent). In the XML protocol,≥99% of completions emit the closing tag;the rare format-violation cases are scored asincorrect.Annotation procedure.The annotator judgeseach case blind to the automatic adjudicator’sdecision. After completing the full batch, dis-agreement cases are re-examined with accessto both the human and automatic judgments toidentify systematic error patterns. A case is con-sidered adjudicator-correct only if the automaticjudgment matches the human judgment after thisre-examination step.S Chain-of-thought baselineTo test whether explicit step-by-step reasoninginstructions reduce residual composition failure,we evaluated Qwen2.5-7B-Instruct on the fullD4V2 benchmark with a modified system promptthat instructs the model to think through eachquestion step by step. The system prompt was:“You are a careful research assistant. No externalevidence is provided. Answer from your internalknowledge only. Think through each questionstep by step: first identify each relevant fact, thenreason about their relationships, and finally com-bine them. If you are genuinely uncertain, answerexactly INSUFFICIENT_EVIDENCE.”Inference used vLLM 0.19 with the model’s na-tive chat template, greedy decoding (T=0 ), andmax_new_tokens = 1024 (doubled from the stan-dard 512 to accommodate reasoning chains). Allother inference parameters and the adjudicationpipeline were identical to the main evaluation(Appendix A). The format instruction required<reasoning> and <answer> XML tags, withstop-string</answer>.Under CoT, atomic stability (consistency gate) is79.7% (63/79 facts stable), compared to 89.9%for standard Qwen2.5-7B-Instruct. Despite the10 pp drop in atomic stability, residual compo-sition failure falls to 43.2% overall (32/74 gate-passing cases). By depth:Table 20: CoT vs. standard Qwen2.5-7B-Instructon D4V2 by depth.n is the number of atomic-gate-passing cases (consistency gate).d=2d=4d=6d=8Standard (residual failure %) 12.0 (25) 69.8 (53) 78.9 (38) 81.1 (37)CoT (residual failure %) 12.5 (16) 39.3 (28) 68.8 (16) 55.6 ( 9)At depths 4 and 8, CoT reduces residual failureby 30 pp and 25 pp respectively, despite smallergate-passingn. The concurrent drop in atomicstability with the improvement in compositionprovides a further demonstration that the twochannels (∆atom and ∆comp) can move in oppositedirections under an intervention that changes onlythe generation process.T Artifact License and AvailabilityThe D4V2 benchmark, evaluation data (case-level records in server_data/), and annota-tion guidelines are released under the CreativeCommons Attribution 4.0 International license(CC BY 4.0). The figure-generation and analysisscripts are released under the MIT License. Allartifacts are available at the supplementary mate-rial accompanying this submission. The models
[[PDF PAGE 20]]evaluated are publicly available open-weightsmodels (Qwen3, Qwen2.5, Mistral, Llama 3) andcommunity-trained variants (DeepHermes-3); noproprietary model access is required to reproducethe results.123version https://git-lfs.github.com/spec/v1oid sha256:2e1b13a0dc9b2ccb41af98b305c03835d10fd9fad781c2f98dce49607bdc9f30size 8618212123version https://git-lfs.github.com/spec/v1oid sha256:84d49a7b0db3a8cc26ee068463981c5f24253e44afc2511ede00e158893823casize 1648853123version https://git-lfs.github.com/spec/v1oid sha256:b1c05d388c86f76e2c98d33535cf850a841e8a7c1a56abded762dba8a0729a60size 9850061234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
PAGE 1Grokking of Implicit Reasoning in Transformers:A Mechanistic Journey to the Edge of GeneralizationBoshi Wang♠ Xiang Yue3∗ Yu Su♠ Huan Sun♠♠The Ohio State University 3Carnegie Mellon University{wang.13930,yue.149,su.809,sun.397}@osu.eduAbstractWe study whether transformers can learn toimplicitly reason over parametric knowl-edge, a skill that even the most capable language models struggle with. Focusing ontwo representative reasoning types, composition and comparison, we consistentlyfind that transformers can learn implicit reasoning, but only through grokking, i.e.,extended training far beyond overfitting. The levels of generalization also varyacross reasoning types: when faced with out-of-distribution examples, transformersfail to systematically generalize for composition but succeed for comparison. Wedelve into the model’s internals throughout training, conducting analytical exper-iments that reveal: 1) the mechanism behind grokking, such as the formation ofthe generalizing circuit and its relation to the relative efficiency of generalizingand memorizing circuits, and 2) the connection between systematicity and theconfiguration of the generalizing circuit. Our findings guide data and trainingsetup to better induce implicit reasoning and suggest potential improvements tothe transformer architecture, such as encouraging cross-layer knowledge sharing.Furthermore, we demonstrate that for a challenging reasoning task with a largesearch space, GPT-4-Turbo and Gemini-1.5-Pro based on non-parametric memoryfail badly regardless of prompting styles or retrieval augmentation, while a fullygrokked transformer can achieve near-perfect accuracy, showcasing the power ofparametric memory for complex reasoning.21 IntroductionLarge language models (LLMs) have been shown deficient inimplicit reasoning with their parametricmemory of knowledge and rules. For example, a range of LLMs are found to be incapable of robustlycomposing internalized facts [ 48, 71], and even GPT-4 [ 42] cannot adequately compare entities’attributes despite knowing them [1].Deficiency in implicit reasoning has profound implications. It implies the models’ limitations in induc-ing structured and compressed representations of facts and rules, which lead to redundant knowledgestorage and difficulty in propagating knowledge updates [76], and importantly, fundamentally impedethe model from systematic generalization over knowledge [25]. While explicit verbalizations ofreasoning steps (e.g., chain-of-thought rationales) can improve task performance [67, 64, 73, 55, 31],they are not available during large-scale (pre-)training where the model’s core capabilities areacquired [77, 29].Is implicit reasoning doomed given that even the most capable models struggle? Can it be resolvedby further scaling data and compute, or are there fundamental limitations of the transformer [62]that prohibit robust acquisition of this skill?∗Project started when at OSU.2Code and data: https://github.com/OSU-NLP-Group/GrokkedTransformer.38th Conference on Neural Information Processing Systems (NeurIPS 2024).
PAGE 2wifeBarack Michelle born inMichelle 1964wifeBarack born in [1964] [younger]ageTrump ageBidenTrump Biden78 82Figure 1: We find that transformers can learn to reason implicitly, but this skill is only robustlyacquired through grokking, i.e., an extended period of training far beyond overfitting. Moreover,the transformer fails to systematically generalize for composition, yet succeeds for comparison. Weconduct a mechanistic study into the model internals throughout grokking, which reveals distinctgeneralizing circuits across the two tasks (Figure 4, 5) that explains the variations in systematicity.In this paper, we rigorously study these questions by constructing synthetic training and evaluationdatasets, training transformers from scratch, and examining their generalization. We conceptualizereasoning as the induction and application of inference rules, and expose the model to a mixture of“atomic facts” and “inferred facts” (which are deduced from the atomic facts via a set of latent rules),resembling “axioms” and “theorems” in a formal system. To evaluate how well the model learnsthe rules, we test its ability to make novel deductions (i.e., completing unseen inferred facts) in bothin-distribution (ID) and out-of-distribution (OOD) scenarios.3 This approach allows us to controlthe training data and perform clean evaluations, which would be challenging when studying existingLLMs trained on uncontrolled data.Our experiments reveal that transformers can learn to perform implicit reasoning, but this skill isonly robustly acquired through extended training far beyond overfitting (Figure 1), a phenomenonknown as grokking [47]. We find that the speed of improvement in generalization correlates withthe ratio between inferred and atomic facts in training, and depends little on the absolute size ofthe training data (Figure 2). This suggests a correction of prior explanations of grokking based oncritical data size [33, 61, 78, 21], in that it should instead be the critical data distribution that decidesthe characteristics of grokking. Our findings extend prior observations of the grokking phenomenonprimarily in algorithmic and linguistic tasks [47, 38] to the domain of knowledge-based reasoning,and deepen our understanding of the grokking phenomenon.Moreover, we find that the transformer exhibits different levels of systematicity across reasoningtypes. While ID generalization is consistently observed, in the OOD setting, the model fails tosystematically generalize for composition but succeeds in comparison (Figure 1). To understand whythis happens, we conduct mechanistic analysis of the internal mechanisms of the model. The analysisuncovers the gradual formation of the generalizing circuit throughout grokking and establishes theconnection between systematicity and its configuration, specifically, the way atomic knowledgeand rules are stored and applied within the circuit. Our findings imply that proper cross-layermemory-sharing mechanisms for transformers such as memory-augmentation [54, 17] and explicitrecurrence [7, 22, 57] are needed to further unlock transformer’s generalization.Finally, to demonstrate the power and potential of parametric memory for complex reasoning, weshow that for a reasoning task with a large search space, a fully grokked transformer can achievenear-perfect accuracy, while state-of-the-art LLMs like GPT-4-Turbo [43] and Gemini-1.5-Pro [16]based on non-parametric memory fail badly regardless of prompting styles or retrieval augmentation.3Definitions of ID/OOD are introduced in §2.2
PAGE 32 General SetupTraining data & ID/OOD evaluation. As stated in §1, we are interested in whether transformerscan induce and apply latent rules over knowledge implicitly in a generalizable way. We create a data-generating process consisting of 1) sampling a set of basic atomic facts, and 2) using the atomic factsand latent rules to deduce inferred facts. To better characterize the level of generalization acquired bythe model, we evaluate the model’s in-distribution (ID) and out-of-distribution (OOD) performance.We prepare two separate sets of atomic facts: atomicID and atomicOOD. Our training set includesall the atomic facts and a uniformly random portion of the inferred facts deduced from atomicID,which we call train_inferredID. For evaluation, (1) ID generalization aims to evaluate whetherthe model learns the latent rules correctly, by testing its ability to complete unseen inferred factsalso deduced from atomicID, which we denote by test_inferredID. (2) OOD generalizationaims to evaluate the systematicity [25] acquired by the model, namely, the ability to apply rules overknowledge regardless of its distribution. To do this, we test the model on the facts deduced fromatomicOOD, denoted by test_inferredOOD.Model & optimization. We use a standard decoder-only transformer model as in GPT-2 [50] with8 layers, 768 hidden dimensions and 12 attention heads (we explore the impact of different modelscales in Appendix B). Optimization is done by AdamW [ 34] with learning rate 10−4, batch size512, weight decay 0.1 and 2000 warm-up steps. Notably, models are trained for a large number ofepochs/steps beyond the point where training performance saturates. More details are in Appendix A.3 Composition—Delayed Generalization without SystematicityWe begin our investigation with composition, where a model needs to “chain” different pieces offacts, e.g., “Barack’s wife is Michelle” and “Michelle is born in 1964”, to successfully completea compositional sentence, e.g., “Barack’s wife is born in [1964]”. Prior work extensively studiedwhether transformer-based language models can perform implicit composition, and negative resultsare consistently reported [48, 1, 71]. Specifically, there exists a “compositionality gap” [48], i.e.,the frequency at which the model knows all the underlying basic facts but fails to compose them,which is considerable across different LLMs and does not decrease as models scale. Are transformersdoomed to fail on such kind of reasoning, and if so, why?3.1 SetupWe focus on two-hop composition in this work. For atomic facts, we generate a random knowledgegraphG consisting of|E| entities and|R| = 200 relations, where each entity (as the subject) has 20random distinct relations that each connects to another random entity (as the object). The atomicfacts are then the edges, i.e., (subject, relation, object) triplets inG, which we partition disjointly intoatomicID and atomicOOD (95%: 5%). The rule of (two-hop) composition is∀h,b,t ∈E ,∀r1,r 2∈R, (h,r 1,b )∧ (b,r 2,t ) =⇒ (h,r 1,r 2,t ), (1)which is used to deduce the ID and OOD inferred facts fromatomicID and atomicOOD, respectively.For convenience, in the above rule, we will callh the head entity,b the bridge entity, andt the tailentity. For both atomic and inferred facts, training/testing is done by having the model predict thefinal tail entity. We assign a unique token to each relation/entity by default, and also find that theresults are robust to different tokenizations (details in Appendix C).We study the influence of the following two aspects on the model’s learned behaviors:• Ratio between inferred and atomic facts. By varying the amount of inferred facts included intraining, we study the effect of the ratioϕ =|train_inferredID|/|atomicID| on the model.• Training data size. We study the impact of the training data size by varying|E|, the total numberof entities, while controlling the ratioϕ. Note that the size of training data (both atomic/inferredfacts) scales linearly with|E|.3.2 ResultsGrokking observed in ID generalization but not in OOD generalization. Figure 1(left) shows themodel’s accuracy on the train and test facts throughout optimization, with|E| = 2000 andϕ = 7.2.3
PAGE 4We find that the model can generalize to ID test examples, but high performance is only achievedthrough extended training far beyond overfitting, a phenomenon calledgrokking [47]. Specifically, thetraining performance saturates (over 99% accuracy on both atomic and inferred facts) at around 14Koptimization steps, before which the highest ID generalization accuracy is merely 9.2%. However,generalization keeps improving by simply training for longer, and approaches almost perfect accuracyafter extended optimization lasting around 50 times the steps taken to fit the training data. On theother hand, OOD generalization is never observed. We extend the training to 2 million optimizationsteps, and there is still no sign of OOD generalization.Inferred/atomic ratio ϕ correlates with generalization speed . Figure 2(a) shows the ID testaccuracy across differentϕ. We omit the other splits since for all settings, the training performancesaturates quickly and the OOD test accuracy remains at zero as earlier.4 It could be seen that the ratioϕ strongly correlates with the speed of generalization. A very large ratio can push generalization toimprove at a similar pace as the model fits the training data, reducing the need for extended training.5104105Optimization Step (Log Scale)0.00.20.40.60.81.0AccuracyRatio (Inferred/Atomic)3.65.47.29.012.618.0(a) Effect of changing ratioϕ (|E| = 2000).0 50 100 150# Epoch0.00.20.40.60.81.0Accuracy| |: 10K| |: 5K| |: 2KTrain (ID)Test (ID)Test (OOD) (b) Effect of changing |E| (ϕ = 9.0).Figure 2: The speed of grokking on the in-distribution (ID) test performance (a) correlates with theratio between inferred and atomic facts, and (b) is not influenced by the size of training data.Training data distribution, instead of training data size, qualitatively influences generalizationbehavior. Whenϕ increases and|E| holds constant, the size of training data also gets larger. Priorstudies hypothesize that training data size plays a central role in order for grokking to happen. Inparticular, previous work connects grokking with the notion ofcritical data size(CDS) [33, 61, 78, 21],where it is hypothesized that CDS marks the shift from memorization to generalization (via grokking),and the speed of generalization improves as the training data further scales. However, results fromour controlled experiments seem to contradict such a hypothesis. Figure 2(b) shows the resultsof varying |E| with a fixed ϕ = 9 .0, where we change the horizontal axis from optimizationstep to epoch for better visualization. 6 When fixing the ratio ϕ, the training data size does notqualitatively affect the model’s generalization. Specifically, scaling the data affects neither therelative speed of ID generalization and training improvement (as seen by the rather constant “gap”between train_inferredID and test_inferredID curves), nor the systematicity level (OODperformance stays zero). We also run the experiments across differentϕ and find the results to beconsistent. This suggests that critical data “distribution”, not size, may be the actual deciding factorbehind grokking and generalization. In addition, we find that scaling up the model size also does notqualitatively change the generalization behaviors observed here (Appendix B), and the main patternis that larger models converge in fewer optimization steps, which shares with prior findings [60, 28].Summary. We have shown that transformers are capable of acquiring the rule of composition throughgrokking, with controlled experiments suggesting the crucial factor of data distribution (e.g., theinferred/atomic ratioϕ) in characterizing the model’s generalization. However, important questions4The training performances of all settings saturate within 25K steps, where largerϕ takes more steps.5Whenϕ = 18.0, the model achieves 96.7% accuracy before training performance saturates.6The optimization steps for each epoch scale linearly with the training size since we use a fixed batch size.4
PAGE 5still remain: what happens during grokking, why does it happen, and why do transformers strugglewith OOD examples? Answering these questions requires a deeper understanding of (the changes in)the model’s inner workings, which we investigate next.3.3 Analyzing the inner workings of the model throughout grokkingWe analyze the internal mechanisms within the model via a combination of two prevalent approaches:logit lens and causal tracing. We apply our analysis to the setting with|E| = 2000,ϕ = 9.0 on 300random examples from train_inferredID.…………ℎ 𝑟𝑟1 𝑟𝑟2…………ℎ 𝑟𝑟2𝑟𝑟1′𝑡𝑡′(≠ 𝑡𝑡) 𝑡𝑡(3) Intervention? ……Measure changeInput & OutputEmbeddingsFinal LayerNormPosition Encoding𝑟𝑟1 𝑒𝑒8 𝑒𝑒5(1) Normal run(2) Perturbed runLayer 0Layer 1Layer 4Layer 5Layer 8……Logit Lensℎ 𝑟𝑟1 𝑟𝑟2𝑟𝑟2 …Layer 0Layer 5Layer 8𝑡𝑡…𝑏𝑏 … …𝑎𝑎 𝑒𝑒1 𝑒𝑒2𝑣𝑣2 …Layer 0Layer 5Layer 8𝑡𝑡…… …Layer 7𝑣𝑣1𝑎𝑎< 𝑎𝑎= 𝑎𝑎>Activations in Normal runStates Affected by InterventionFigure 3: Illustration of our circuit analysis approach (on the composition task). We use logit lensto interpret individual states, and use causal tracing to measure the strength of connections betweenstates. Details are in the main content.Logit lens. We interpret individual hidden states via logit lens [40, 15, 71], where the activation isconverted into a set of logits for each vocabulary token by multiplying with the output embeddingmatrix. We follow the recent practice [71] where the activation first goes through the transformer’sfinal normalization layer before multiplying with the output embedding (Figure 3, top right).Causal tracing. The transformer could be viewed as a causal graph [46] that propagates informationfrom the input to the output through a grid of intermediate states, which allows for a variety of causalanalyses on its internal computations [63, 35, 19, 65, 12]. For convenience, we will refer to a hiddenstate byS[i,a ], wherei is the layer index anda marks the role of the input token at the same positionas the state (one of {h,r 1,r 2}). We illustrate our method in Figure 3, where the hidden state ofinterest isS[4,r 1] and the target is the model’s prediction stateS[8,r 2]. There are in total three steps:1. The normal run records the model’s hidden state activations on a regular input (h,r 1,r 2).Note that since the model maintains perfect training performance throughout grokking, the finalprediction is always the ground truth tail entityt.72. In the perturbed run, a slightly perturbed input is fed to the model which changes the prediction,where again the hidden state activations are recorded. For the perturbation, prior work has exploredadding noise to the input [35] and replacing key tokens with semantically close ones [63, 12]. Weadopt token replacement which avoids unnecessary distribution shifts [74]. Specifically, for thehidden state of interest, we replace the input token at the same position as the state to be a randomalternative of the same type (e.g.,r1→r′1) that leads to a different target prediction (e.g.,t→t′).3. Intervention. During the normal run, we intervene the state of interest by replacing its activationwith its activation in the perturbed run. We then run the remaining computations and measure ifthe target state (top-1 token through logit lens) is altered. The ratio of such alterations (between 0and 1) among the examples quantitatively characterizes the causal strength between the state ofinterest and the target.7For convenience, when we refer to a state as a token, we mean the top token of the state via logit lens.5
PAGE 6ℎ 𝑟𝑟1 𝑟𝑟2𝑟𝑟2 …Layer 0Layer 5Layer 8𝑡𝑡…𝑏𝑏 … …(a)h r1 r2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00 (b)0.0 0.5 1.0 1.5 2.0 2.5 3.0Optimization step (1e5)0.00.20.40.60.81.0Grokking startsMRR(b) at S[5, r1]MRR(r2) at S[5, r2]T est (ID)T est (OOD) (c)Figure 4: The (evolution of) generalizing circuit for composition. (a) The generalizing circuit. (b)The change in causal strengths during grokking, where the target is the prediction state. (c) Meanreciprocal rank (via logit lens) of the bridge entityb atS[5,r 1] and second relationr2 atS[5,r 2].The generalizing circuit. We run a set of causal tracing and logit lens experiments across differentmodel checkpoints throughout training. The discovered generalizing circuit (i.e., the causal com-putational pathways after grokking) is illustrated in Figure 4(a). Specifically, we locate a highlyinterpretable causal graph consisting of states in layer 0, 5, and 8, where we have pruned away theweak nodes/connections (details in Appendix D). Layer 5 splits the circuit into lower and upperlayers, where 1) the lower layers retrieve the first-hop fact (h,r 1,b ) from the inputh,r 1, store thebridge entityb inS[5,r 1], and “delay” the processing ofr2 toS[5,r 2]; 2) the upper layers retrieve thesecond-hop fact (b,r 2,t ) fromS[5,r 1] andS[5,r 2], and store the tailt to the output stateS[8,r 2].What happens during grokking? To understand the underlying mechanism behind grokking, wetrack the strengths of causal connections and results from logit lens across different model checkpointsduring grokking (the “start” of grokking is the point when training performance saturates). Weobserve two notable amplifications (within the identified graph) that happen during grokking. Thefirst is the causal connection betweenS[5,r 1] and the final predictiont, which is very weak beforegrokking (Appendix D) and grows significantly during grokking (Figure 4(b)). The second is ther2component ofS[5,r 2] via logit lens, for which we plot its mean reciprocal rank (MRR) (Figure 4(c)).Additionally, we find that the stateS[5,r 1] has a large component of the bridge entityb throughoutgrokking (Figure 4(c)). These observations strongly suggest that the model is gradually formingthe second hop in the upper layers (5-8) during grokking. This also indicates that, before grokking,the model is very likely mostly memorizing the examples in train_inferredID by directlyassociating (h,r 1,r 2) witht, without going through the first hop.Why does grokking happen? These observations suggest a natural explanation of why grokkinghappens through the lens of circuit efficiency [61]. Specifically, as illustrated above, there exist botha memorizing circuit Cmem and a generalizing circuit Cgen that can fit the training data. WhileCmem is learned first (which causes training performance to saturate quickly),Cgen is relatively moreefficient, in the sense that it could fit the data with a lower complexity. To see this, we can comparethe amount of factsCmem andCgen need to store (denoted asNmem andNgen) as a proxy for theircomplexity.8 Cmem stores both atomic facts and inferred facts in the weights. Cgen (Figure 4(a))stores the atomic facts in the lower layers, and another copy of the atomic facts that appear as thesecond hop in the inferred facts in the upper layers. As the inferred/atomic ratioϕ increases,Nmemwould increase rapidly whileNgen increases slowly and is always bounded by two times the totalamount of atomic facts, and hence, the relative efficiency ofCgen increases. In the long run, the modelwill be incentivized to transition fromCmem toCgen due to implicit bias of the optimization [53] andexplicit regularization such as weight decay which prefers more efficient circuits, and the transitionwould happen faster asϕ increases. This also explains why the training data size does not affect thespeed of grokking, since solely increasing the size does not change the relative efficiency ofCmemandCgen. The explanation also implies that a larger regularization factor should accelerate grokking(and vice versa), which we confirm by varying the degree of weight decay (Appendix E.1).8While the circuits also consist of other components, they pale in comparison as the number of facts scales.6
PAGE 7Explaining and mitigating the deficiency in OOD generalization. The configuration ofCgen alsohas another important implication: while the model does acquire compositionality through grokking,it does not have any incentive to store atomic facts in the upper layers that do not appear as thesecond hop during training . This explains why the model fails in the OOD setting where factsare only observed in the atomic form, not in the compositional form—the OOD atomic facts aresimply not stored in the upper layers when queried during the second hop. 9 Such issue originatesfrom the non-recurrent design of the transformer architecture which forbids memory sharing acrossdifferent layers. Our study provides a mechanistic understanding of existing findings that transformersseem to reduce compositional reasoning to linearized pattern matching [ 10], and also provides apotential explanation for the observations in recent findings that LLMs only show substantial positiveevidence in performing the first hop reasoning but not the second [71]. Our findings imply that propercross-layer memory-sharing mechanisms for transformers such as memory-augmentation [54, 17] andexplicit recurrence [7, 22, 57] are needed to improve their generalization. We also show that a variantof the parameter-sharing scheme in Univeral Transformer [7] can improve OOD generalization incomposition (Appendix E.2).4 Comparison—Systematic Generalization via Parallel CircuitWe have just shown that the vanilla transformer fails to achieve OOD generalization for composition,but is the vanilla transformer generally incapable of acquiring systematic implicit reasoning skills?We show that for comparison, a task where SoTA LLMs such as GPT-4 also struggle [1], the vanillatransformer does have the capability to acquire systematic generalization, again through grokking. Onthe surface, it seems that the comparison task is no different than the composition task—both requireretrieving and reasoning over two pieces of facts. However, as it turns out through our analysis,thecomparison task emits a “parallel circuit” that is learned by the transformer during grokking, whichallows atomic facts to be stored and retrieved in the same region and enables systematicity to happen.Setup. The comparison task involves comparing the attribute values of entities. We assume thereare|E| = 1000 entities,|A| = 20 attributes and|V| = 20 ordinal values for the attributes. Eachattributea∈A has a label space{a<,a =,a >}, a set of relations specifying its comparative form. Forexample, an attribute age would havea<,a =,a > to be younger, contemporary, older, respectively.The atomic facts are (entity, attribute, value) triplets, where we assign a random value v∈V foreach (e,a )∈E×A . Again, we randomly partition the atomic facts into atomicID and atomicOOD(90%: 10%). The rules of comparison are:∀e1,e 2∈E ,∀a∈A,∀v1,v 2∈V , (e1,a,v 1)∧ (e2,a,v 2)∧v1 <v 2 =⇒ (a,e 1,e 2,a <),∀e1,e 2∈E ,∀a∈A,∀v1,v 2∈V , (e1,a,v 1)∧ (e2,a,v 2)∧v1 =v2 =⇒ (a,e 1,e 2,a =),∀e1,e 2∈E ,∀a∈A,∀v1,v 2∈V , (e1,a,v 1)∧ (e2,a,v 2)∧v1 >v 2 =⇒ (a,e 1,e 2,a >).(2)Take the attribute age as an example, the first rule means if the age of e1 is smaller than theage ofe2, then we can infer “In terms of age, the relation between e1 ande2 is younger”. Eachentity/attribute/value/label is assigned a unique token, and training/testing is done by having themodel predict the last token (attribute value for atomic facts; comparative relation for inferred facts).Results & analysis. Figure 1(right) shows the results forϕ = 7.2, and we include more results inAppendix E.3. It can be seen that 1) the model again acquires robust generalization only throughgrokking; 2) surprisingly, the model also achieves systematicity in generalization, different from thecase of composition.Analyzing the model’s internals similarly as in §3.3 (details in Appendix D), we find the generalizingcircuit for comparison illustrated in Figure 5(a). On a separate stream, the model prepares the labelspace{a<,a =,a >} froma and stores it in S[7,a ]. In the lower layers ( 0-5), the model retrievesthe two atomic facts and stores the attribute values v1 andv2 atS[5,e 1] andS[5,e 2]. Then, theupper layers (5-8) comparev1,v 2 and fetch the label fromS[7,a ] based on the comparison result.Importantly, there is a major difference compared with the circuit for composition: the two atomicfacts are retrievedin parallel, which suggests that the atomic facts are stored solely in the lower layers,without having separate copies across different regions as in the circuit for composition. This explainswhy systematicity could happen: OOD facts are now stored and accessed in the same way as ID9We verified that in the OOD setting,S[5,r 1] andS[5,r 2] encodeb andr2 respectively as in the ID case.7
PAGE 8facts. Tracking the changes in the model throughout grokking, we observe significantly strengthenedcausal connections fromS[7,a ] andS[5,e 1] to the final prediction (Figure 5(b)). We also find thatthroughout grokking,S[7,a ] always encodes the label space andS[5,e 1],S [5,e 2] gradually encodethe two attribute values (Figure 5(c)). This confirms that a similar transition from Cmem toCgenhappens during grokking.…………ℎ 𝑟𝑟1 𝑟𝑟2…………ℎ 𝑟𝑟2𝑟𝑟1′𝑡𝑡′(≠ 𝑡𝑡) 𝑡𝑡Intervention? ……Measure changeInput & OutputEmbeddingsFinal LayerNormPosition Encoding𝑟𝑟1 𝑒𝑒8 𝑒𝑒5Normal runPerturbed runLayer 0Layer 1Layer 4Layer 5Layer 8……Logit Lensℎ 𝑟𝑟1 𝑟𝑟2𝑟𝑟2 …Layer 0Layer 5Layer 8𝑡𝑡…𝑏𝑏 … …𝑎𝑎 𝑒𝑒1 𝑒𝑒2𝑣𝑣2 …Layer 0Layer 5Layer 8𝑡𝑡…… …Layer 7𝑣𝑣1𝑎𝑎< 𝑎𝑎= 𝑎𝑎>(a)a e1 e2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00 (b)0 1 2 3 4 5Optimization step (1e5)0.20.40.60.81.0Grokking startsMRR(v1) at S[5, e1]MRR(v2) at S[5, e2]T est (ID)T est (OOD) (c)Figure 5: The (evolution of) generalizing circuit for comparison. (a) The generalizing circuit. (b)The change in causal strengths during grokking, where the target is the prediction state. (c) Meanreciprocal rank (via logit lens) of the two attribute values (v1,v 2) atS[5,e 1] andS[5,e 2].The findings here showcase transformer’s ability to learn parallel solutions to seemingly sequentialproblems, akin to the findings in Liu et al. [ 30] where it is shown that transformers can learn“shortcuts” to automata. The difference in the acquired generalization across the two tasks thatwe study also emphasizes the need for controlled and mechanistic study on understanding thetransformer’s reasoning before making general claims on its limitations.5 The Power of Parametric Memory for Complex ReasoningAt the high level, our study so far paves the way towards better understanding and improvingtransformer’s reasoning withparametric representation of knowledge and rules. But why is parametricmemory practically important? Can we not simply enhance LLMs with non-parametric memory, e.g.,by using their long-context modes and/or doing explicit retrieval, to solve the tasks at hand?We believe parametric memory has its unique capability to performdeep compression and integrationof information for complex reasoning. To showcase the potential of parametric memory for complexreasoning, we create a difficult reasoning task with a large search space, and show that 1) it is far outof reach even for current SoTA models (e.g., GPT-4-Turbo [43] and Gemini-Pro-1.5 [16]) based onnon-parametric memory; 2) a fully grokked transformer can solve the task with near-perfect accuracy.Our task is a variation of the comparison task above where we use a simple way to massively expandthe search space, based on an additional set of rules that are already contained within the task itself,namely, the (anti-)symmetry and transitivity of comparison:∀e1,e 2∈E ,∀a∈A, (a,e 1,e 2,a </a=/a>) =⇒ (a,e 2,e 1,a >/a=/a<),∀e1,e 2,e 3∈E ,∀a∈A,∀y∈{a<,a =,a >}, (a,e 1,e 2,y )∧ (a,e 2,e 3,y ) =⇒ (a,e 1,e 3,y ). (3)In the original setting (§4) of the task, for the OOD test set, one can simply retrieve the two OODfacts and compare the attribute values, which requires no further search. We change the task settingvia the following. For each attribute, 1) we do not add the OOD atomic facts into training, and 2) weadd a random portion of the comparisons between ID entities and OOD entities into training. We testthe models on queries consisting of derivable (from all training facts) comparisons between OODentities where any possible proof would involve rules from both Eqs.(2) and Eqs.(3). Consequently,answering a test query would require the model to successfully locate two ID bridge entities whichcan connect the two query entities into a proof (Figure 6). We select a balanced (by a<,a =,a >)subset from these queries for evaluation. More details are included in Appendix F.The difficulty of such a task is two-fold. First, the search space is large. For example, on average,each query entity connects with more than 50 facts, and each bridge entity in the ground truth proof8
PAGE 9John RickLeoSamBenEveBobMaxJoeTom10Mia135Query EntityBridge EntityGold ProofFigure 6: Illustration of the complex reasoning task, which involves comparing the attributes of twoquery entities based on a set of facts encompassing a large search space.connects with more than 900 facts. Second, there are no surface form clues to exploit and bias thesearch towards the ground truth proof, unlike most conventional QA benchmarks where the proofsteps are transparent from the query.To test LLMs based on non-parametric memory, we translate the facts into natural language by simpletemplates (Appendix F). Facts/queries for each attribute are grouped/tested separately. 10 We testboth the vanilla setup where all facts (28.2K on average) are loaded into the LLM context, and theretrieval-augmented setup (5.4K facts retrieved on average) where the two-hop neighborhoods of thetwo query entities are retrieved, which includes enough facts to deduce the answer. We also try bothstandard prompting where the model answers directly, and chain-of-thought (CoT) prompting wherethe model is prompted to verbalize the reasoning. We test GPT-4-Turbo and Gemini-Pro-1.5, wherefor GPT-4-Turbo we only test the retrieval-augmented setup due to context length limit.Table 1: Results on the complex reasoning task. Direct/CoT: predict the answer directly/verbalize thereasoning steps. “+R”: retrieval augmentation.GPT-4-Turbo Gemini-Pro-1.5 Grokked TransformerDirect+R CoT+R Direct CoT Direct+R CoT+RAccuracy (%) 33.3 31.3 28.7 11.3 37.3 12.0 99.3Results. As shown in Table 1, all models based on non-parametric memory fail badly, where the onlysetting that surpasses random guess (33.3%) is the retrieval-augmented setting with Gemini-Pro-1.5and direct answer prediction. Intriguingly, LLMs perform worse (especially Gemini) when promptedto reason verbally. Through closer examinations, we find that with CoT,70.7% of Gemini’s responsesconclude that the answer cannot be decided (which we treat as wrong since the answer can be decided)after a series of search steps.11 More shockingly, most of the CoT rationales that achieve the correctfinal answer are actually wrong due to either hallucinating underivable facts or logical errors. Thisillustrates the current models’ inability to reason deeply with non-parametric memory. On the otherhand, a grokked transformer, which is trained extensively on the given facts to compress and integratethe information to the extreme, could achieve near-perfect accuracy. By examining the model, wefind that it acquires the same generalizing circuit as in Figure 5(a), and remarkably, even thoughnot explicitly encouraged/trained to do this, the model successfully infers most of the OOD entities’attribute values by integrating the observed training facts (Appendix F).6 Related WorkKnowledge and reasoning in language models. Numerous work finds that transformer languagemodels, even SoTA ones such as GPT-4, struggle in implicit reasoning over their parametric knowl-edge [56, 23, 52, 51, 48, 1, 71], suggesting their limitations in inducing structured and compressedrepresentations of facts and rules during training. A series of efforts try to understand transformer’sknowledge and reasoning through controlled experiments [24, 49, 10, 66], which is also our focus. We10This could also be thought of as performing a retrieval step into the memory based on the attribute.11The ratio drops a bit to 58.7% when augmenting with retrieval.9
PAGE 10find that transformers can learn implicit reasoning over knowledge through grokking, and characterizethe connection between the acquired systematicity level and the inductive bias of transformer.“Chain-of-Thought” and verbalized reasoning . A series of studies prompt/fine-tune languagemodels to verbalize (i.e., generate) the intermediate knowledge and reasoning steps [67, 64, 73, 55,31, 72] during inference, which has been shown to improve performance especially for large modelswith strong generation capabilities. There are also theoretical results showing the benefits of suchverbalizations [11, 27]. Our focus here on implicit reasoning is orthogonal, and it is an interestingopen problem to have principled understandings of the role of such verbalizations in reasoningproblems, and also develop methods that can decide the appropriate balance between implicit andexplicit reasoning to handle challenging problems with large intrinsic complexity. Relatedly, recentwork also finds that explicit verbalizations could be a useful medium for teaching models to reasonimplicitly via distillation or curriculum [9, 8].Grokking is first discovered by Power et al. [47] on a set of small algorithmic reasoning tasks. Theintriguing phenomenon inspired follow-up works proposing different explanations and expanding theset of tasks where grokking is observed [59, 32, 6, 41, 39, 61, 36, 38, 33, 78, 21]. To our knowledge,we are the first work to observe grokking in the domain of knowledge-based reasoning, and ourcontrolled experiments suggest potential corrections of prior hypotheses based on critical data size.Our formulation of rule induction from atomic and inferred facts is general, which we hope couldinspire future work on understanding grokking and generalization in deep learning.Analyzing the inner workings of neural models. Recent work tries to open up the “black box” ofneural models through a wide range of techniques; see survey in Ferrando et al. [13]. We apply causaltracing [63, 35, 19, 65, 12] and logit lens [40, 15, 71] to discover interpretable circuits in the modelto understand the grokking process and how/why generalization happens.Parametric and non-parametric memory. Our focus in this work is on parametric memory inlanguage models, and an orthogonal direction is to enhance models with non-parametric memory,such as extending the effective context length [70, 43, 14, 16] and augmenting with retrieval [18, 26, 3,58, 75, 37]. The two types of memory are largely complementary to each other—parametric memoryhas its unique ability to compress and integrate information but is also inevitably lossy and subject tohallucination, while non-parametric memory is lossless and could also provide attribution. Similarlyfor humans—a human acquires expertise in a domain by acquiring and structuring knowledge inthe brain (parametric), but he/she also wouldn’t memorize all pieces of details and could refer tothe source when necessary (non-parametric). How to decide the tradeoff between parametric andnon-parametric memory (or, how to define the objective for such a tradeoff) is another interestingopen problem for future work.7 ConclusionWe find that transformers are capable of learning to implicitly reason over parametric knowledge,however, such a skill is only robustly acquired through extended training far beyond the point ofoverfitting, or grokking. Mechanistic analysis into the model’s internals reveals the configuration andgradual formation of the generalizing circuit, and also explains the different levels of systematicitythe model acquires across tasks. These findings guide data and training setup to better induce implicitreasoning, and suggest potential improvements to the transformer architecture to further unlock itsgeneralization. We conclude by showcasing the unique power of parametric memory on a challengingreasoning task with a large search space.LimitationsScope of our task formulation. As mentioned in §1, we formulate the implicit reasoning problem asinduction and application of inference rules from a mixture of atomic and inferred facts. This may notapply to the full spectrum of reasoning which has a range of different types and meanings [20]. Still,our formulation could capture the nature of a wide range of reasoning problems, and crucially, webelieve that it is a good conceptualization of certain aspects of language model (pre-)training, wherethe model needs to both memorize the “atomic” world knowledge and also induce generalizable rulesfrom the massive amount of records of human activities, which allow the model to connect and reasonover knowledge, and ultimately help with humans.10
PAGE 11Abstract nature and connection with practice. Our study has an abstract nature, which is requiredfor the complete solidity and rigor of our experiments and evaluation. We also strive to makesure that the results are robust to different setups closer to practice through additional experiments(Appendix B,C,E). Still, there are certain distances from our settings to those in practice. However,we believe that it is far more important to build solid understandings, even having distances withpractice, than to draw conclusions or make claims that are closer to practice but questionable due toinsufficient control over data and evaluations.AcknowledgementThe authors would like to thank colleagues from the OSU NLP group and CMU NeuLab fortheir thoughtful comments. This research was supported in part by NSF CAREER #1942980,ARL W911NF2220144, NSF OAC 2112606, and Ohio Supercomputer Center [5]. The views andconclusions contained herein are those of the authors and should not be interpreted as representingthe official policies, either expressed or implied, of the U.S. government. The U.S. Governmentis authorized to reproduce and distribute reprints for Government purposes notwithstanding anycopyright notice herein.References[1] Zeyuan Allen-Zhu and Yuanzhi Li. Physics of language models: Part 3.2, knowledge manipula-tion. In arXiv preprint: abs/2309.14402, 2023.[2] Nora Belrose, Zach Furman, Logan Smith, Danny Halawi, Igor Ostrovsky, Lev McKinney,Stella Biderman, and Jacob Steinhardt. Eliciting latent predictions from transformers with thetuned lens. In arXiv preprint: abs/2303.08112, 2023.[3] Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, KatieMillican, George Bm Van Den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark,et al. Improving language models by retrieving from trillions of tokens. In Internationalconference on machine learning, pages 2206–2240. PMLR, 2022.[4] Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, and TriDao. Medusa: Simple llm inference acceleration framework with multiple decoding heads. InarXiv preprint: abs/2401.10774, 2024.[5] Ohio Supercomputer Center. Ohio supercomputer center, 1987.[6] Xander Davies, Lauro Langosco, and David Krueger. Unifying grokking and double descent.In NeurIPS ML Safety Workshop, 2022.[7] Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. Uni-versal transformers. In International Conference on Learning Representations, 2019.[8] Yuntian Deng, Yejin Choi, and Stuart Shieber. From explicit cot to implicit cot: Learning tointernalize cot step by step. In arXiv preprint: abs/2405.14838, 2024.[9] Yuntian Deng, Kiran Prasad, Roland Fernandez, Paul Smolensky, Vishrav Chaudhary, andStuart Shieber. Implicit chain of thought reasoning via knowledge distillation. In arXiv preprint:abs/2311.01460, 2023.[10] Nouha Dziri, Ximing Lu, Melanie Sclar, Xiang Lorraine Li, Liwei Jiang, Bill Yuchen Lin,Sean Welleck, Peter West, Chandra Bhagavatula, Ronan Le Bras, Jena D. Hwang, SoumyaSanyal, Xiang Ren, Allyson Ettinger, Zaid Harchaoui, and Yejin Choi. Faith and fate: Limitsof transformers on compositionality. In Thirty-seventh Conference on Neural InformationProcessing Systems, 2023.[11] Guhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye, Di He, and Liwei Wang. Towardsrevealing the mystery behind chain of thought: A theoretical perspective. In Thirty-seventhConference on Neural Information Processing Systems, 2023.11
PAGE 12[12] Jiahai Feng and Jacob Steinhardt. How do language models bind entities in context? In TheTwelfth International Conference on Learning Representations, 2024.[13] Javier Ferrando, Gabriele Sarti, Arianna Bisazza, and Marta R. Costa-jussà. A primer on theinner workings of transformer-based language models. In arXiv preprint: abs/2405.00208 ,2024.[14] Yao Fu, Rameswar Panda, Xinyao Niu, Xiang Yue, Hannaneh Hajishirzi, Yoon Kim, and HaoPeng. Data engineering for scaling language models to 128k context, 2024.[15] Mor Geva, Avi Caciularu, Kevin Wang, and Yoav Goldberg. Transformer feed-forward layersbuild predictions by promoting concepts in the vocabulary space. In Proceedings of the 2022Conference on Empirical Methods in Natural Language Processing, pages 30–45, Abu Dhabi,United Arab Emirates, December 2022. Association for Computational Linguistics.[16] Google. Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context.2024.[17] Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwi´nska, Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou,et al. Hybrid computing using a neural network with dynamic external memory. Nature,538(7626):471–476, 2016.[18] Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Mingwei Chang. Retrievalaugmented language model pre-training. In International conference on machine learning ,pages 3929–3938. PMLR, 2020.[19] Michael Hanna, Ollie Liu, and Alexandre Variengien. How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model. In Thirty-seventhConference on Neural Information Processing Systems, 2023.[20] Jie Huang and Kevin Chen-Chuan Chang. Towards reasoning in large language models: Asurvey. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki, editors, Findings of theAssociation for Computational Linguistics: ACL 2023, pages 1049–1065, Toronto, Canada, July2023. Association for Computational Linguistics.[21] Yufei Huang, Shengding Hu, Xu Han, Zhiyuan Liu, and Maosong Sun. Unified view ofgrokking, double descent and emergent abilities: A perspective from circuits competition. InarXiv preprint: abs/2402.15175, 2024.[22] DeLesley Hutchins, Imanol Schlag, Yuhuai Wu, Ethan Dyer, and Behnam Neyshabur. Block-recurrent transformers. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and KyunghyunCho, editors, Advances in Neural Information Processing Systems, 2022.[23] Nora Kassner, Benno Krojer, and Hinrich Schütze. Are pretrained language models symbolicreasoners over knowledge? In Proceedings of the 24th Conference on Computational NaturalLanguage Learning, pages 552–564, Online, November 2020. Association for ComputationalLinguistics.[24] Nora Kassner, Benno Krojer, and Hinrich Schütze. Are pretrained language models symbolicreasoners over knowledge? In Proceedings of the 24th Conference on Computational NaturalLanguage Learning, pages 552–564, Online, November 2020. Association for ComputationalLinguistics.[25] Brenden Lake and Marco Baroni. Generalization without systematicity: On the compositionalskills of sequence-to-sequence recurrent networks. In International conference on machinelearning, pages 2873–2882. PMLR, 2018.[26] Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, NamanGoyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. Retrieval-augmentedgeneration for knowledge-intensive nlp tasks. Advances in Neural Information ProcessingSystems, 33:9459–9474, 2020.12
PAGE 13[27] Zhiyuan Li, Hong Liu, Denny Zhou, and Tengyu Ma. Chain of thought empowers transformersto solve inherently serial problems. In The Twelfth International Conference on LearningRepresentations, 2024.[28] Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joey Gon-zalez. Train big, then compress: Rethinking model size for efficient training and inference oftransformers. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th InternationalConference on Machine Learning, volume 119 of Proceedings of Machine Learning Research,pages 5958–5968. PMLR, 13–18 Jul 2020.[29] Bill Yuchen Lin, Abhilasha Ravichander, Ximing Lu, Nouha Dziri, Melanie Sclar, KhyathiChandu, Chandra Bhagavatula, and Yejin Choi. The unlocking spell on base LLMs: Rethinkingalignment via in-context learning. In The Twelfth International Conference on LearningRepresentations, 2024.[30] Bingbin Liu, Jordan T. Ash, Surbhi Goel, Akshay Krishnamurthy, and Cyril Zhang. Trans-formers learn shortcuts to automata. In The Eleventh International Conference on LearningRepresentations, 2023.[31] Jiacheng Liu, Ramakanth Pasunuru, Hannaneh Hajishirzi, Yejin Choi, and Asli Celikyilmaz.Crystal: Introspective reasoners reinforced with self-feedback. In Houda Bouamor, JuanPino, and Kalika Bali, editors, Proceedings of the 2023 Conference on Empirical Methods inNatural Language Processing, pages 11557–11572, Singapore, December 2023. Associationfor Computational Linguistics.[32] Ziming Liu, Ouail Kitouni, Niklas Nolte, Eric J Michaud, Max Tegmark, and Mike Williams.Towards understanding grokking: An effective theory of representation learning. In Alice H.Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors, Advances in NeuralInformation Processing Systems, 2022.[33] Ziming Liu, Eric J Michaud, and Max Tegmark. Omnigrok: Grokking beyond algorithmic data.In The Eleventh International Conference on Learning Representations, 2023.[34] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In InternationalConference on Learning Representations, 2019.[35] Kevin Meng, David Bau, Alex J Andonian, and Yonatan Belinkov. Locating and editing factualassociations in GPT. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho,editors, Advances in Neural Information Processing Systems, 2022.[36] William Merrill, Nikolaos Tsilivis, and Aman Shukla. A tale of two circuits: Grokking ascompetition of sparse and dense subnetworks. In ICLR 2023 Workshop on Mathematical andEmpirical Understanding of Foundation Models, 2023.[37] Sewon Min, Weijia Shi, Mike Lewis, Xilun Chen, Wen-tau Yih, Hannaneh Hajishirzi, andLuke Zettlemoyer. Nonparametric masked language modeling. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki, editors, Findings of the Association for Computational Linguistics:ACL 2023, pages 2097–2118, Toronto, Canada, July 2023. Association for ComputationalLinguistics.[38] Shikhar Murty, Pratyusha Sharma, Jacob Andreas, and Christopher Manning. Grokking ofhierarchical structure in vanilla transformers. In Anna Rogers, Jordan Boyd-Graber, and NaoakiOkazaki, editors, Proceedings of the 61st Annual Meeting of the Association for ComputationalLinguistics (Volume 2: Short Papers), pages 439–448, Toronto, Canada, July 2023. Associationfor Computational Linguistics.[39] Neel Nanda, Lawrence Chan, Tom Lieberum, Jess Smith, and Jacob Steinhardt. Progressmeasures for grokking via mechanistic interpretability. InThe Eleventh International Conferenceon Learning Representations, 2023.[40] nostalgebraist. interpreting gpt: the logit lens. 2020.13
PAGE 14[41] Pascal Jr. Tikeng Notsawo, Hattie Zhou, Mohammad Pezeshki, Irina Rish, and GuillaumeDumas. Predicting grokking long before it happens: A look into the loss landscape of modelswhich grok. In arXiv preprint: abs/2306.13253, 2023.[42] OpenAI. Gpt-4 technical report. In arXiv preprint: abs/2303.08774, 2023.[43] OpenAI. New models and developer products announced at devday. 2023.[44] Koyena Pal, Jiuding Sun, Andrew Yuan, Byron Wallace, and David Bau. Future lens: Antici-pating subsequent tokens from a single hidden state. In Jing Jiang, David Reitter, and ShuminDeng, editors, Proceedings of the 27th Conference on Computational Natural Language Learn-ing (CoNLL), pages 548–560, Singapore, December 2023. Association for ComputationalLinguistics.[45] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan,Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperativestyle, high-performance deep learning library. Advances in neural information processingsystems, 32, 2019.[46] Judea Pearl. Causality. Cambridge university press, 2009.[47] Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, and Vedant Misra. Grokking: Gen-eralization beyond overfitting on small algorithmic datasets. In arXiv preprint: abs/2201.02177,2022.[48] Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt, Noah Smith, and Mike Lewis. Measuringand narrowing the compositionality gap in language models. In Houda Bouamor, Juan Pino, andKalika Bali, editors, Findings of the Association for Computational Linguistics: EMNLP 2023,pages 5687–5711, Singapore, December 2023. Association for Computational Linguistics.[49] Ben Prystawski, Michael Y . Li, and Noah Goodman. Why think step by step? reasoningemerges from the locality of experience. In Thirty-seventh Conference on Neural InformationProcessing Systems, 2023.[50] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al.Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.[51] Jack W Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song,John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, et al. Scaling languagemodels: Methods, analysis & insights from training gopher. arXiv preprint arXiv:2112.11446,2021.[52] Anna Rogers, Olga Kovaleva, and Anna Rumshisky. A primer in BERTology: What weknow about how BERT works. Transactions of the Association for Computational Linguistics,8:842–866, 2020.[53] Daniel Soudry, Elad Hoffer, and Nathan Srebro. The implicit bias of gradient descent onseparable data. In International Conference on Learning Representations, 2018.[54] Sainbayar Sukhbaatar, Jason Weston, Rob Fergus, et al. End-to-end memory networks.Advancesin neural information processing systems, 28, 2015.[55] Zhiqing Sun, Xuezhi Wang, Yi Tay, Yiming Yang, and Denny Zhou. Recitation-augmentedlanguage models. In The Eleventh International Conference on Learning Representations, 2023.[56] Alon Talmor, Yanai Elazar, Yoav Goldberg, and Jonathan Berant. olmpics-on what languagemodel pre-training captures. Transactions of the Association for Computational Linguistics,8:743–758, 2020.[57] Shawn Tan, Yikang Shen, Zhenfang Chen, Aaron Courville, and Chuang Gan. Sparse universaltransformer. In Houda Bouamor, Juan Pino, and Kalika Bali, editors, Proceedings of the 2023Conference on Empirical Methods in Natural Language Processing, pages 169–179, Singapore,December 2023. Association for Computational Linguistics.14
PAGE 15[58] Yi Tay, Vinh Q. Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, KaiHui, Zhe Zhao, Jai Gupta, Tal Schuster, William W. Cohen, and Donald Metzler. Transformermemory as a differentiable search index. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave,and Kyunghyun Cho, editors, Advances in Neural Information Processing Systems, 2022.[59] Vimal Thilak, Etai Littwin, Shuangfei Zhai, Omid Saremi, Roni Paiss, and Joshua Susskind. Theslingshot mechanism: An empirical study of adaptive optimizers and the grokking phenomenon.In arXiv preprint: abs/2206.04817, 2022.[60] Kushal Tirumala, Aram Markosyan, Luke Zettlemoyer, and Armen Aghajanyan. Memorizationwithout overfitting: Analyzing the training dynamics of large language models. Advances inNeural Information Processing Systems, 35:38274–38290, 2022.[61] Vikrant Varma, Rohin Shah, Zachary Kenton, János Kramár, and Ramana Kumar. Explaininggrokking through circuit efficiency. In arXiv preprint: abs/2309.02390, 2023.[62] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez,Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural informationprocessing systems, 30, 2017.[63] Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Yaron Singer,and Stuart Shieber. Investigating gender bias in language models using causal mediationanalysis. Advances in neural information processing systems, 33:12388–12401, 2020.[64] Boshi Wang, Xiang Deng, and Huan Sun. Iteratively prompt pre-trained language models forchain of thought. In Proceedings of the 2022 Conference on Empirical Methods in NaturalLanguage Processing, pages 2714–2730, Abu Dhabi, United Arab Emirates, December 2022.Association for Computational Linguistics.[65] Kevin Ro Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt.Interpretability in the wild: a circuit for indirect object identification in GPT-2 small. In TheEleventh International Conference on Learning Representations, 2023.[66] Xinyi Wang, Alfonso Amayuelas, Kexun Zhang, Liangming Pan, Wenhu Chen, andWilliam Yang Wang. Understanding the reasoning ability of language models from the perspec-tive of reasoning paths aggregation. In arXiv preprint: abs/2402.03268, 2024.[67] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, brian ichter, Fei Xia, Ed H. Chi,Quoc V Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large languagemodels. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors,Advances in Neural Information Processing Systems, 2022.[68] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, AnthonyMoi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer,Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, SylvainGugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. Transformers: State-of-the-artnatural language processing. In Proceedings of the 2020 Conference on Empirical Methods inNatural Language Processing: System Demonstrations, pages 38–45, Online, October 2020.Association for Computational Linguistics.[69] Wilson Wu, John X. Morris, and Lionel Levine. Do language models plan ahead for futuretokens? In arXiv preprint: abs/2404.00859, 2024.[70] Wenhan Xiong, Jingyu Liu, Igor Molybog, Hejia Zhang, Prajjwal Bhargava, Rui Hou, LouisMartin, Rashi Rungta, Karthik Abinav Sankararaman, Barlas Oguz, Madian Khabsa, Han Fang,Yashar Mehdad, Sharan Narang, Kshitiz Malik, Angela Fan, Shruti Bhosale, Sergey Edunov,Mike Lewis, Sinong Wang, and Hao Ma. Effective long-context scaling of foundation models,2023.[71] Sohee Yang, Elena Gribovskaya, Nora Kassner, Mor Geva, and Sebastian Riedel. Do largelanguage models latently perform multi-hop reasoning? In arXiv preprint: abs/2402.16837,2024.15
PAGE 16[72] Eric Zelikman, Georges Harik, Yijia Shao, Varuna Jayasiri, Nick Haber, and Noah D. Goodman.Quiet-star: Language models can teach themselves to think before speaking. In arXiv preprint:abs/2403.09629, 2024.[73] Eric Zelikman, Yuhuai Wu, Jesse Mu, and Noah Goodman. STar: Bootstrapping reasoning withreasoning. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho, editors,Advances in Neural Information Processing Systems, 2022.[74] Fred Zhang and Neel Nanda. Towards best practices of activation patching in language models:Metrics and methods. In arXiv preprint: abs/2309.16042, 2024.[75] Zexuan Zhong, Tao Lei, and Danqi Chen. Training language models with memory augmen-tation. In Proceedings of the 2022 Conference on Empirical Methods in Natural LanguageProcessing, pages 5657–5673, Abu Dhabi, United Arab Emirates, December 2022. Associationfor Computational Linguistics.[76] Zexuan Zhong, Zhengxuan Wu, Christopher Manning, Christopher Potts, and Danqi Chen.MQuAKE: Assessing knowledge editing in language models via multi-hop questions. In HoudaBouamor, Juan Pino, and Kalika Bali, editors,Proceedings of the 2023 Conference on EmpiricalMethods in Natural Language Processing, pages 15686–15702, Singapore, December 2023.Association for Computational Linguistics.[77] Chunting Zhou, Pengfei Liu, Puxin Xu, Srini Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, AviaEfrat, Ping Yu, LILI YU, Susan Zhang, Gargi Ghosh, Mike Lewis, Luke Zettlemoyer, and OmerLevy. LIMA: Less is more for alignment. In Thirty-seventh Conference on Neural InformationProcessing Systems, 2023.[78] Xuekai Zhu, Yao Fu, Bowen Zhou, and Zhouhan Lin. Critical data size of language modelsfrom a grokking perspective. In arXiv preprint: abs/2401.10463, 2024.16
PAGE 17A Training DetailsAll implementations were done with PyTorch [45] and Huggingface Transformers [68]. All modeltraining runs are done on NVIDIA A6000 and A100 GPUs and last 96 hours at maximum.B Effect of Model ScaleWe run the experiments on composition with larger model scales with |E| = 2000 and ϕ ∈{5.4, 9.0, 18.0}. The results are shown in Figure 7. Overall, it could be seen that scaling upthe model won’t qualitatively change the model’s generalization behaviors, and the main pattern isthat larger models converge in fewer optimization steps, which shares with prior findings [60, 28].5000 10000 15000 20000 25000 30000Optimization step0.00.20.40.60.81.0Accuracy8 Layers, 768 Dim24 Layers, 1024 Dim36 Layers, 1280 DimTrain (ID)T est (ID)T est (OOD)(a)ϕ = 18.0.2500 5000 7500 10000 12500 15000 17500 20000 22500Optimization step0.00.20.40.60.81.0Accuracy8 Layers, 768 Dim24 Layers, 1024 Dim36 Layers, 1280 DimTrain (ID)T est (ID)T est (OOD) (b)ϕ = 5.4.5000 10000 15000 20000 25000 30000Optimization step0.00.20.40.60.81.0Accuracy8 Layers, 768 Dim24 Layers, 1024 Dim36 Layers, 1280 DimTrain (ID)T est (ID)T est (OOD)(c)ϕ = 9.0.Figure 7: Results for different model scales across different ϕ. Larger models converge in feweroptimization steps, but have no qualitative changes on the learned behaviors.C Effect of TokenizationsIn the experiments in our main content, tokenization is done by having a unique token for eachentity.12 This is different from how real-world entities are typically tokenized—in practice, entitiesare usually multi-token, and different entities could share tokens at different positions. We investigate12Preliminary experiments show that tokenization of the relations does not exhibit notable impacts, which isexpected since relations are always explicitly given.17
PAGE 18the effect of tokenizations on the composition task by having two tokens for each entity (resemblingthe first name and last name of a person) in the setting with|E| = 2000 andϕ = 12.6. We generate aset of unique first names and a set of unique last names with equal size from which the two tokens foreach entity are randomly chosen (we make sure each entity gets a unique ordered pair of tokens). Wedefine token multiplicity to be the number of entities that share the same first/last name. For example,when the size of the set of first/last names is 50, the token multiplicity would be 2000/50 = 40 .Figure 8(a) shows the ID test results, where the training and OOD results are the same from earlier(training performance saturates quickly, OOD result remains zero). It can be seen that a larger tokenmultiplicity would delay the generalization, which is expected to a certain degree since the scaleof the model is effectively smaller due to having fewer tokens in the vocabulary. Nevertheless, IDgeneralization always happens. We also run linear probing onS[5,r 1] throughout training to predictthe second token of the bridge entityb in the setting with token multiplicity 40,13, where the resultsare shown in Figure 8(b). It can be seen that the second token of b can be perfectly decoded fromS[5,r 1] after grokking, and the decodability improves throughout grokking. This suggests that forthe multi-token case, the model is additionally storing the second token ofb intoS[5,r 1] throughoutgrokking, which may be another factor that further delays the speed of grokking. These results alsoshare with recent findings that in many cases, tokens beyond the immediate next token are linearlyencoded in the hidden states [69, 44, 2, 4].In summary, different tokenizations affect the results in rather expected ways, and do not influenceour main findings and conclusions.0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4Optimization step 1e60.00.20.40.60.81.0AccuracyMultiplicity: 1Multiplicity: 4Multiplicity: 8Multiplicity: 16Multiplicity: 40(a)0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4Optimization step 1e60.00.20.40.60.81.0AccuracyT est (ID)Probing accuracy (b)Figure 8: (a) ID generalization across different token multiplicity. (b) Probing accuracy on the secondtoken ofb atS[5,r 1].D More Details on Circuit AnalysisD.1 CompositionWe run causal tracing on hidden states in layer 1-7 and every position, where the target is the finalprediction stateS[8,r 2]. The changes in the strengths are monotone and smooth, and we show inFigure 9 the strengths for the model checkpoint at the start and end of grokking, and also theirdifference (same as Figure 4(b)). We also find that after grokking, the stateS[5,r 2] (which encodesr2) is not affected by perturbing the inputh orr1.Deriving the generalizing circuit. Starting from the 9 states in layers 0, 5, 8 we can directly eliminateS[8,h ] andS[8,r 1] since they have no computational paths connecting to S[8,r 2]. S[5,h ] can beeliminated as could be seen by Figure 9(c). The connections from S[0,h ] andS[0,r 1] toS[5,r 2]could be eliminated as mentioned earlier.13Recall thatS[5,r 1] is the state that encodes the bridge entity in the generalizing circuit (Figure 4(a))18
PAGE 19h r1 r2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00(a)h r1 r2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00 (b)h r1 r2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00 (c)Figure 9: Causal strengths on composition task, with the final prediction S[8,r 2] as the target. (a)Start of grokking. (b) Change during grokking. (c) End of grokking.D.2 ComparisonFigure 10 includes the causal tracing results where the target is the prediction state S[8,e 2], andFigure 11 includes the results with the target stateS[5,e 2]. It can be seen that after grokking,S[5,e 2]does not depend one1, which gives the generalization circuit in Figure 5(a).Figure 12 shows the rank (via logit lens) of the three relations{a<,a =,a >} in the label space at stateS[7,a ], where we use Recall@3 as the measure. It can be seen thatS[7,a ] encodes the label spacethroughout grokking.a e1 e2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00(a)a e1 e2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00 (b)a e1 e2Layer 1Layer 2Layer 3Layer 4Layer 5Layer 6Layer 71.000.750.500.250.000.250.500.751.00 (c)Figure 10: Causal strengths on comparison task, with the final predictionS[8,e 2] as the target. (a)Start of grokking. (b) Change during grokking. (c) End of grokking.E Additional ResultsE.1 Weight decayFigure 13 shows the ID generalization performance when varying the degree of weight decay(|E| = 2000 and ϕ = 9.0). It can be seen that a larger weight decay can improve the speed ofgrokking, and vice versa.19
PAGE 20a e1 e2Layer 0Layer 1Layer 2Layer 3Layer 41.000.750.500.250.000.250.500.751.00(a)a e1 e2Layer 0Layer 1Layer 2Layer 3Layer 41.000.750.500.250.000.250.500.751.00 (b)a e1 e2Layer 0Layer 1Layer 2Layer 3Layer 41.000.750.500.250.000.250.500.751.00 (c)Figure 11: Causal strengths on comparison task, with S[5,e 2] as the target. (a) Start of grokking. (b)Change during grokking. (c) End of grokking.0 1 2 3 4Optimization step (1e5)0.50.60.70.80.91.0Recall@3T est (ID)T est (OOD)Figure 12: For the comparison task,S[7,a ] encodes the label space throughout grokking.E.2 Transformer with parameter sharingWe share the parameters of the first 4 layers and the last 4 layers, similar as in Universal Trans-former [7]. This would allow the model to share the knowledge in the upper and lower layers. Theresults on the setting with|E| = 2000 andϕ = 12.6 are shown in Figure 14. It could be seen thatthe parameter-sharing scheme can unlock OOD generalization, even though it is gained much moreslowly than ID generalization during grokking.E.3 Comparison task across different inferred/atomic ratioFigure 15 includes the result for ϕ∈{ 3.6, 7.2, 9.0, 12.6} for the comparison task. It can be seenthat a higher ratio ϕ would give a higher generalization speed, consistent with the results in thecomposition task.F Complex Reasoning TaskFor the complex reasoning task, for each attribute, we include 3% random facts from the comparisonsbetween ID and OOD entities and the comparisons between ID and ID entities. In total, the trainingset contains 18K ID atomic facts, 437K (ID, ID) comparisons, and 108K (ID, OOD) comparisons,altogether 563K facts ( 28K on average for each attribute). For translating the facts into natural20
PAGE 210.0 0.5 1.0 1.5 2.0 2.5 3.0Optimization step (1e5)0.00.20.40.60.81.0Accuracyweight decay: 0.03weight decay: 0.1weight decay: 0.3Figure 13: Effect of weight decay. A larger weight decay can improve the speed of grokking, andvice versa.0.00 0.25 0.50 0.75 1.00 1.25 1.50Optimization step 1e60.00.20.40.60.81.0AccuracyT est (ID)T est (OOD)Figure 14: OOD accuracy of the shared-parameter transformer model.language for testing LLMs with non-parametric memory, we always use the attribute age14 (we findthat the choice of attribute does not exhibit notable impact) and the templates “The age of {entity} is{attribute value}.” and “{entity 1} is {younger than/older than/in the same age as} {entity 2}.” foratomic facts and comparisons. The entities are mapped to distinct random names generated by arandom generator.15 We also try different mappings (e.g., unique IDs) and templates, and find theresults to be consistent. All (retrieved) facts are randomly permuted and concatenated before beingloaded into the LLM context.The train/test accuracy, and also the accuracy of inferring the attribute values of the query entities(which we test using the same format as the atomic facts in training) are included in Figure 16. Itcould be seen that, during grokking, the model gradually locates the ground truth attribute values ofthe query entities (note that the model is not explicitly encouraged or trained to do this), allowing themodel to solve the problem efficiently with near-perfect accuracy.14Recall that we test each attribute separately by grouping the facts/queries.15https://pypi.org/project/names/21
PAGE 220 1 2 3 4 5Optimization step (1e5)0.650.700.750.800.850.900.951.00Accuracy: 12.6: 9.0: 7.2: 3.6(a) ID accuracy.0 1 2 3 4 5Optimization step (1e5)0.650.700.750.800.850.900.951.00Accuracy: 12.6: 9.0: 7.2: 3.6 (b) OOD accuracy.Figure 15: Results for the comparison task across different ratioϕ.0 1 2 3 4 5 6 7Optimization step (1e5)0.20.40.60.81.0AccuracyTrainT estAtomic (OOD)Figure 16: Accuracy on the train and test split, and also the accuracy of inferring the attribute valuesof the query entities (Atomic (OOD)) for the complex reasoning task in §5.NeurIPS Paper Checklist1. ClaimsQuestion: Do the main claims made in the abstract and introduction accurately reflect thepaper’s contributions and scope?Answer: [Yes]Justification: All the findings and claims that we make are based on evidence from a set ofcontrolled experiments, as presented in the different main sections §3,4,5. We also strive tomake sure that the results are robust to alternative setups through additional experimentsincluded in Appendix B,C,E.Guidelines:• The answer NA means that the abstract and introduction do not include the claimsmade in the paper.• The abstract and/or introduction should clearly state the claims made, including thecontributions made in the paper and important assumptions and limitations. A No orNA answer to this question will not be perceived well by the reviewers.• The claims made should match theoretical and experimental results, and reflect howmuch the results can be expected to generalize to other settings.22
PAGE 23• It is fine to include aspirational goals as motivation as long as it is clear that these goalsare not attained by the paper.2. LimitationsQuestion: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes]Justification: We have discussed the potential limitations of our work in Appendix 7. We donot include it in the main content for the submission due to space limits, and will add it tothe main content in the final version (if the paper is accepted).Guidelines:• The answer NA means that the paper has no limitation while the answer No means thatthe paper has limitations, but those are not discussed in the paper.• The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are toviolations of these assumptions (e.g., independence assumptions, noiseless settings,model well-specification, asymptotic approximations only holding locally). The authorsshould reflect on how these assumptions might be violated in practice and what theimplications would be.• The authors should reflect on the scope of the claims made, e.g., if the approach wasonly tested on a few datasets or with a few runs. In general, empirical results oftendepend on implicit assumptions, which should be articulated.• The authors should reflect on the factors that influence the performance of the approach.For example, a facial recognition algorithm may perform poorly when image resolutionis low or images are taken in low lighting. Or a speech-to-text system might not beused reliably to provide closed captions for online lectures because it fails to handletechnical jargon.• The authors should discuss the computational efficiency of the proposed algorithmsand how they scale with dataset size.• If applicable, the authors should discuss possible limitations of their approach toaddress problems of privacy and fairness.• While the authors might fear that complete honesty about limitations might be used byreviewers as grounds for rejection, a worse outcome might be that reviewers discoverlimitations that aren’t acknowledged in the paper. The authors should use their bestjudgment and recognize that individual actions in favor of transparency play an impor-tant role in developing norms that preserve the integrity of the community. Reviewerswill be specifically instructed to not penalize honesty concerning limitations.3. Theory Assumptions and ProofsQuestion: For each theoretical result, does the paper provide the full set of assumptions anda complete (and correct) proof?Answer: [NA]Justification: We do not include theoretical results in this paper.Guidelines:• The answer NA means that the paper does not include theoretical results.• All the theorems, formulas, and proofs in the paper should be numbered and cross-referenced.• All assumptions should be clearly stated or referenced in the statement of any theorems.• The proofs can either appear in the main paper or the supplemental material, but ifthey appear in the supplemental material, the authors are encouraged to provide a shortproof sketch to provide intuition.• Inversely, any informal proof provided in the core of the paper should be complementedby formal proofs provided in appendix or supplemental material.• Theorems and Lemmas that the proof relies upon should be properly referenced.4. Experimental Result Reproducibility23
PAGE 24Question: Does the paper fully disclose all the information needed to reproduce the main ex-perimental results of the paper to the extent that it affects the main claims and/or conclusionsof the paper (regardless of whether the code and data are provided or not)?Answer: [Yes]Justification: We provide full details on our data, model and training configurations, andevaluation setup in §2,3,4,5 and the Appendix.Guidelines:• The answer NA means that the paper does not include experiments.• If the paper includes experiments, a No answer to this question will not be perceivedwell by the reviewers: Making the paper reproducible is important, regardless ofwhether the code and data are provided or not.• If the contribution is a dataset and/or model, the authors should describe the steps takento make their results reproducible or verifiable.• Depending on the contribution, reproducibility can be accomplished in various ways.For example, if the contribution is a novel architecture, describing the architecture fullymight suffice, or if the contribution is a specific model and empirical evaluation, it maybe necessary to either make it possible for others to replicate the model with the samedataset, or provide access to the model. In general. releasing code and data is oftenone good way to accomplish this, but reproducibility can also be provided via detailedinstructions for how to replicate the results, access to a hosted model (e.g., in the caseof a large language model), releasing of a model checkpoint, or other means that areappropriate to the research performed.• While NeurIPS does not require releasing code, the conference does require all submis-sions to provide some reasonable avenue for reproducibility, which may depend on thenature of the contribution. For example(a) If the contribution is primarily a new algorithm, the paper should make it clear howto reproduce that algorithm.(b) If the contribution is primarily a new model architecture, the paper should describethe architecture clearly and fully.(c) If the contribution is a new model (e.g., a large language model), then there shouldeither be a way to access this model for reproducing the results or a way to reproducethe model (e.g., with an open-source dataset or instructions for how to constructthe dataset).(d) We recognize that reproducibility may be tricky in some cases, in which caseauthors are welcome to describe the particular way they provide for reproducibility.In the case of closed-source models, it may be that access to the model is limited insome way (e.g., to registered users), but it should be possible for other researchersto have some path to reproducing or verifying the results.5. Open access to data and codeQuestion: Does the paper provide open access to the data and code, with sufficient instruc-tions to faithfully reproduce the main experimental results, as described in supplementalmaterial?Answer: [Yes]Justification: We have released the data and code with sufficient documentations alongsidethe release.Guidelines:• The answer NA means that paper does not include experiments requiring code.• Please see the NeurIPS code and data submission guidelines (https://nips.cc/public/guides/CodeSubmissionPolicy) for more details.• While we encourage the release of code and data, we understand that this might not bepossible, so “No” is an acceptable answer. Papers cannot be rejected simply for notincluding code, unless this is central to the contribution (e.g., for a new open-sourcebenchmark).24
PAGE 25• The instructions should contain the exact command and environment needed to run toreproduce the results. See the NeurIPS code and data submission guidelines (https://nips.cc/public/guides/CodeSubmissionPolicy) for more details.• The authors should provide instructions on data access and preparation, including howto access the raw data, preprocessed data, intermediate data, and generated data, etc.• The authors should provide scripts to reproduce all experimental results for the newproposed method and baselines. If only a subset of experiments are reproducible, theyshould state which ones are omitted from the script and why.• At submission time, to preserve anonymity, the authors should release anonymizedversions (if applicable).• Providing as much information as possible in supplemental material (appended to thepaper) is recommended, but including URLs to data and code is permitted.6. Experimental Setting/DetailsQuestion: Does the paper specify all the training and test details (e.g., data splits, hyper-parameters, how they were chosen, type of optimizer, etc.) necessary to understand theresults?Answer: [Yes]Justification: We provide full details on our data, model and training configurations, andevaluation setup in §2,3,4,5 and the Appendix.Guidelines:• The answer NA means that the paper does not include experiments.• The experimental setting should be presented in the core of the paper to a level of detailthat is necessary to appreciate the results and make sense of them.• The full details can be provided either with the code, in appendix, or as supplementalmaterial.7. Experiment Statistical SignificanceQuestion: Does the paper report error bars suitably and correctly defined or other appropriateinformation about the statistical significance of the experiments?Answer: [No]Justification: All of our experimental results are obtained with specified random seeds forreproducibility. We do not perform extensive additional re-runs of the experiments, however,we find preliminarily that the results are very robust to randomness in the setup. In addition,our results exhibit strong patterns from controlled variations in the parameter settings, whichwe believe is a side-proof that the results are statistically significant.Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confi-dence intervals, or statistical significance tests, at least for the experiments that supportthe main claims of the paper.• The factors of variability that the error bars are capturing should be clearly stated (forexample, train/test split, initialization, random drawing of some parameter, or overallrun with given experimental conditions).• The method for calculating the error bars should be explained (closed form formula,call to a library function, bootstrap, etc.)• The assumptions made should be given (e.g., Normally distributed errors).• It should be clear whether the error bar is the standard deviation or the standard errorof the mean.• It is OK to report 1-sigma error bars, but one should state it. The authors shouldpreferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesisof Normality of errors is not verified.• For asymmetric distributions, the authors should be careful not to show in tables orfigures symmetric error bars that would yield results that are out of range (e.g. negativeerror rates).25
PAGE 26• If error bars are reported in tables or plots, The authors should explain in the text howthey were calculated and reference the corresponding figures or tables in the text.8. Experiments Compute ResourcesQuestion: For each experiment, does the paper provide sufficient information on the com-puter resources (type of compute workers, memory, time of execution) needed to reproducethe experiments?Answer: [Yes]Justification: We provide details on computing resources in Appendix A.Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster,or cloud provider, including relevant memory and storage.• The paper should provide the amount of compute required for each of the individualexperimental runs as well as estimate the total compute.• The paper should disclose whether the full research project required more computethan the experiments reported in the paper (e.g., preliminary or failed experiments thatdidn’t make it into the paper).9. Code Of EthicsQuestion: Does the research conducted in the paper conform, in every respect, with theNeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines?Answer: [Yes]Justification: We believe our research conforms with the Code of Ethics in every respect.Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require adeviation from the Code of Ethics.• The authors should make sure to preserve anonymity (e.g., if there is a special consid-eration due to laws or regulations in their jurisdiction).10. Broader ImpactsQuestion: Does the paper discuss both potential positive societal impacts and negativesocietal impacts of the work performed?Answer: [No]Justification: Our research is at the foundational level which is not tied to particular applica-tions or deployments, and hence we believe there are no negative societal impacts.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societalimpact or why the paper does not address societal impact.• Examples of negative societal impacts include potential malicious or unintended uses(e.g., disinformation, generating fake profiles, surveillance), fairness considerations(e.g., deployment of technologies that could make decisions that unfairly impact specificgroups), privacy considerations, and security considerations.• The conference expects that many papers will be foundational research and not tiedto particular applications, let alone deployments. However, if there is a direct path toany negative applications, the authors should point it out. For example, it is legitimateto point out that an improvement in the quality of generative models could be used togenerate deepfakes for disinformation. On the other hand, it is not needed to point outthat a generic algorithm for optimizing neural networks could enable people to trainmodels that generate Deepfakes faster.26
PAGE 27• The authors should consider possible harms that could arise when the technology isbeing used as intended and functioning correctly, harms that could arise when thetechnology is being used as intended but gives incorrect results, and harms followingfrom (intentional or unintentional) misuse of the technology.• If there are negative societal impacts, the authors could also discuss possible mitigationstrategies (e.g., gated release of models, providing defenses in addition to attacks,mechanisms for monitoring misuse, mechanisms to monitor how a system learns fromfeedback over time, improving the efficiency and accessibility of ML).11. SafeguardsQuestion: Does the paper describe safeguards that have been put in place for responsiblerelease of data or models that have a high risk for misuse (e.g., pretrained language models,image generators, or scraped datasets)?Answer: [NA]Justification: We believe our work poses no such risks.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released withnecessary safeguards to allow for controlled use of the model, for example by requiringthat users adhere to usage guidelines or restrictions to access the model or implementingsafety filters.• Datasets that have been scraped from the Internet could pose safety risks. The authorsshould describe how they avoided releasing unsafe images.• We recognize that providing effective safeguards is challenging, and many papers donot require this, but we encourage authors to take this into account and make a bestfaith effort.12. Licenses for existing assetsQuestion: Are the creators or original owners of assets (e.g., code, data, models), used inthe paper, properly credited and are the license and terms of use explicitly mentioned andproperly respected?Answer: [Yes]Justification: We have credited the original creators of assets such as the code framework inAppendix A.Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include aURL.• The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms ofservice of that source should be provided.• If assets are released, the license, copyright information, and terms of use in the packageshould be provided. For popular datasets, paperswithcode.com/datasets hascurated licenses for some datasets. Their licensing guide can help determine the licenseof a dataset.• For existing datasets that are re-packaged, both the original license and the license ofthe derived asset (if it has changed) should be provided.• If this information is not available online, the authors are encouraged to reach out tothe asset’s creators.13. New AssetsQuestion: Are new assets introduced in the paper well documented and is the documentationprovided alongside the assets?Answer: [Yes]27
PAGE 28Justification: We have documented our assets alongside the release.Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of theirsubmissions via structured templates. This includes details about training, license,limitations, etc.• The paper should discuss whether and how consent was obtained from people whoseasset is used.• At submission time, remember to anonymize your assets (if applicable). You can eithercreate an anonymized URL or include an anonymized zip file.14. Crowdsourcing and Research with Human SubjectsQuestion: For crowdsourcing experiments and research with human subjects, does the paperinclude the full text of instructions given to participants and screenshots, if applicable, aswell as details about compensation (if any)?Answer: [NA]Justification: Our work is not involved with such subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research withhuman subjects.• Including this information in the supplemental material is fine, but if the main contribu-tion of the paper involves human subjects, then as much detail as possible should beincluded in the main paper.• According to the NeurIPS Code of Ethics, workers involved in data collection, curation,or other labor should be paid at least the minimum wage in the country of the datacollector.15. Institutional Review Board (IRB) Approvals or Equivalent for Research with HumanSubjectsQuestion: Does the paper describe potential risks incurred by study participants, whethersuch risks were disclosed to the subjects, and whether Institutional Review Board (IRB)approvals (or an equivalent approval/review based on the requirements of your country orinstitution) were obtained?Answer: [NA]Justification: Our work is not involved with such subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research withhuman subjects.• Depending on the country in which research is conducted, IRB approval (or equivalent)may be required for any human subjects research. If you obtained IRB approval, youshould clearly state this in the paper.• We recognize that the procedures for this may vary significantly between institutionsand locations, and we expect authors to adhere to the NeurIPS Code of Ethics and theguidelines for their institution.• For initial submissions, do not include any information that would break anonymity (ifapplicable), such as the institution conducting the review.28123version https://git-lfs.github.com/spec/v1oid sha256:27d27d0e0f91f9ecd2fb74ab5b4e1d1cf6c1202a1f51e59918ad71efe0357d85size 1886413123version https://git-lfs.github.com/spec/v1oid sha256:b7fc31c7a7f85b1eb7733bac76ac5e01c4a7316bb8b45333b39617120c467d64size 15061361234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828[[PDF PAGE 1]]Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing , pages 14113–14130November 12-16, 2024 ©2024 Association for Computational LinguisticsHopping Too Late: Exploring the Limitations ofLarge Language Models on Multi-Hop QueriesEden Biran1 Daniela Gottesman1 Sohee Yang2 Mor Geva1 Amir Globerson1,31Tel Aviv University 2UCL 3Google Researchedenbiran@mail.tau.ac.ilAbstractLarge language models (LLMs) can solve com-plex multi-step problems, but little is knownabout how these computations are implementedinternally. Motivated by this, we study howLLMs answer multi-hop queries such as “Thespouse of the performer of Imagine is”. Thesequeries require two information extractionsteps: a latent one for resolving the first hop(“the performer of Imagine”) into the bridgeentity (John Lennon), and another for resolvingthe second hop (“the spouse of John Lennon”)into the target entity (Yoko Ono). Understand-ing how the latent step is computed internallyis key to understanding the overall computa-tion. By carefully analyzing the internal com-putations of transformer-based LLMs, we dis-cover that the bridge entity is resolved in theearly layers of the model. Then, only afterthis resolution, the two-hop query is solved inthe later layers. Because the second hop com-mences in later layers, there could be caseswhere these layers no longer encode the nec-essary knowledge for correctly predicting theanswer. Motivated by this, we propose a novel“back-patching” analysis method whereby a hid-den representation from a later layer is patchedback to an earlier layer. We find that in up to66% of previously incorrect cases there exists aback-patch that results in the correct generationof the answer, showing that the later layers in-deed sometimes lack the needed functionality.Overall, our methods and findings open furtheropportunities for understanding and improvinglatent reasoning in transformer-based LLMs.1 IntroductionDespite groundbreaking performance in a multi-tude of tasks, large language models (LLMs) stillstruggle with complex knowledge queries (Presset al., 2023; Dziri et al., 2023). For example, LLMsoften err when asked to complete multi-hop queriessuch as “The spouse of the performer of Imagineis”. Answering such queries requires compositionthe spouse of the performer of Imagine isYoko1) First hop is resolved into bridge entity2) Information propagates to last token3) Second hop is resolved into target entity Representation encoding bridge entity “John Lennon”Representation encoding target entity “Yoko Ono”Back-patched representationBack-patchinghidden represen-tation⋮ ⋮ ⋮ ⋮Figure 1: An illustration of our findings: we observeevidence of latent reasoning in two-hop queries where1) During the early layers the first hop is resolved andthe source entity Imagine now encodes the bridge entityJohn Lennon 2) During the middle layers critical infor-mation propagates to the last position 3) During the laterlayers the second hop is resolved and the last token nowencodes the target entity Yoko Ono. We additionallyillustrate back-patching: patching a hidden representa-tion from a later layer back into an earlier layer in orderto fix cases where the pathway fails.and reasoning skills, which have been the focus ofmany recent works (Hou et al., 2023; Brinkmannet al., 2024; Yang et al., 2024; Li et al., 2024a;Wang et al., 2024; Petty et al., 2024). Besides thegeneral interest in compositional skills, the investi-gation of latent multi-hop abilities of LLMs wouldalso have significant implications for areas suchas generalization (Lake and Baroni, 2018; Onoeet al., 2023) and model editing (Zhong et al., 2023;Cohen et al., 2024).To strengthen the latent reasoning ability ofLLMs, it is essential to first understand the inter-nal mechanism of how LLMs successfully com-plete two-hop queries using latent multi-hop rea-soning. While there have been several works thatinvestigate such a mechanism, a precise latent rea-soning pathway has only been found in relatively14113
[[PDF PAGE 2]]small language models trained on synthetic datasets(Brinkmann et al., 2024; Li et al., 2024a; Wanget al., 2024) and has not been thoroughly investi-gated in large pretrained models.Throughout this work we consider and comparetwo complementing settings, one where the modelcorrectly answers the two-hop query and the otherwhen it does not. To this end, in §2, we startby creating and publishing a dataset containing82,020 two-hop queries based on data from Wiki-data (Vrandeˇci´c and Krötzsch, 2014).Our approach to analyzing multi-hop reasoningbegins with the hypothesis that it involves activat-ing the same “knowledge-extraction module” twice:once for the first hop (“the performer of Imagineis John Lennon”) and once for the second ( “thespouse of John Lennon is Yoko Ono” ). The keyquestion we ask in this work is where are these twoprocedures implemented in the LLM. A naturalway to answer this question is to seek the first pointin the network where the outputs of these two stepsappear. The typical approach to this would employvocabulary projections (nostalgebraist, 2020; Gevaet al., 2021; Sakarvadia et al., 2023; Yang et al.,2024; Li et al., 2024a). However, we instead opt fora more recent method named Patchscopes (Ghan-deharioun et al., 2024) which has clear advantagesover the commonly used vocabulary projection.Using this approach, in §3 we find that the out-come of the first hop is clearly evident in the hiddenrepresentation of the end-token of the first hop. Wefurther find that resolving the first hop happens dur-ing the early layers, as depicted in Figure 1 (stage1). Given the localization of the first hop, in §4we then ask where the second hop is resolved. Wefind that it typically appears in the last token of theprompt only in layers after the resolution of the firsthop, as further illustrated in Figure 1 (stage 3).These observations suggest a mechanism wherethe first hop is resolved with the answer, that thenpropagates to the last token to resolve the secondhop (as depicted by stage 2 in Figure 1). We explorethis propagation in §5. Moreover, they suggest whythis process may fail — If the two resolutions aredone by different groups of layers, it must be thatthese two groups are both able to perform knowl-edge extraction, be it via their attention or MLPsublayers. However, since transformers have a lim-ited amount of layers, and their functionality isdifferent (Meng et al., 2022; Geva et al., 2023), it isquite likely that the layer at which the second hopis performed will not have the desired functional-ity. To verify this hypothesis, in §6, we propose ananalysis method named back-patching. The crux ofthe method involves taking a hidden representationfrom a later layer, patching it back into the sameposition of the same prompt in an earlier layer, andthen continuing the forward pass. In a way, thisallows the model more layers to finish the computa-tion without the need for additional parameters ortraining (Petty et al., 2024). Unlike previous meth-ods (Sakarvadia et al., 2023; Li et al., 2024a), back-patching makes no assumption on the structure ofthe prompt and does not require any knowledge ofthe participating entities. Testing back-patching onqueries initially predicted incorrectly, we find thatup to 66% of incorrect cases have the potential tobe correctly predicted using back-patching whenchoosing the optimal source and target layers.Overall, our contributions can be summarized asfollows:• We provide a novel dataset of two-hop queries,which can serve to systematically study thisimportant setting.• We employ Patchscopes to inspect entities en-coded in hidden representations while process-ing two-hop queries.• We identify a sequential latent reasoning path-way in LLMs, where the first hop query isinitially resolved into the bridge entity whichis then used to answer the second hop.• We propose an analysis method named back-patching, that verifies our results and could ad-ditionally be used to improve the performanceof LLMs on multi-hop question answering.We release our code and dataset at https://github.com/edenbiran/HoppingTooLate.2 Experimental Setup2.1 Two-Hop QueriesWe consider facts denoted by a triplet (e, r, e′)where e is a source entity (e.g., John Lennon), ris a relation (e.g., Spouse) and e′ is a target entity(e.g., Yoko Ono). These facts can then be con-verted to factual statements (e.g., “The spouse ofJohn Lennon is Yoko Ono”) and also into queriesby omitting e′ (e.g., “The spouse of John Lennonis ”). We then prompt models with these queries inorder to test their knowledge and reasoning.14114
[[PDF PAGE 3]]We create two-hop queries by composing twofacts where one’s target entity is the other’s sourceentity. Namely, ((e1, r1, e2) and (e2, r2, e3)). Werefer to e1 as the source entity, e2 as the bridgeentity, and e3 as the target entity. For example, thetwo-hop query “The spouse of the performer ofImagine is” can be decomposed into (Imagine, Per-former, John Lennon) and (John Lennon, Spouse,Yoko Ono).We further define two tokens of specific inter-est: the last token of e11 (e.g., “The spouse of theperformer of Imagine”) and the last token of thewhole two-hop prompt (e.g., “The spouse of theperformer of Imagine is”), which we denote as t1and t2, respectively.2.2 DatasetWe create a dataset containing 82,020 two-hopqueries based on data from Wikidata (Vrande ˇci´cand Krötzsch, 2014). First, we sample entities witha maximal amount of Wikidata statements froma set of predefined Wikidata entity types. Theseentities will act as e2. Second, we use a prede-fined set of relations in order to construct the twotriplets (e1, r1, e2) and (e2, r2, e3). Finally we con-vert both triplets into a single natural languagephrase using manually crafted templates per re-lation. We refer to our codebase for further detailsincluding entity types and relations2.We next attempt to filter out cases where no la-tent reasoning is performed. Given a two hop query((e1, r1, e2), (e2, r2, e3)) we test two prompts con-structed to detect and filter out cases where themodel performs reasoning shortcuts (Xu et al.,2022; Wang et al., 2023a; Ju et al., 2024). The firstprompt is the query (("", r1, e2), (e2, r2, e3)) (i.e.,the query without e1), aimed at filtering out caseswhere the model predicts generally popular entities.The second prompt is ((e1, "", e2), (e2, r2, e3))(i.e., the query without r1), aimed at filtering outcases where the model predicts correctly due to ahigh correlation between e1 and e3. For example,given the two-hop query “The spouse of the per-former of Imagine is” we filter out cases where themodel predicts Yoko Ono for either “The spouseof the performer is” or “The spouse of Imagineis”. We perform this filtering for each model usinggreedy decoding creating a per model subset of thedataset. Table 1 displays the amount of examplesleft after this filtering process.1This token is also the last token of the first hop.2All data was retrieved during April 2024.Model Post Filtering Cases TestedCorrect IncorrectLLaMA 2 7B 70, 625 388 351LLaMA 2 13B 70, 972 554 413LLaMA 3 8B 71, 569 379 371LLaMA 3 70B 70, 334 656 595Pythia 6.9B 73, 058 173 202Pythia 12B 74, 056 172 372Table 1: The amount of examples post shortcut filteringand the final amount used throughout all experiments.We are specifically interested in understandingthe differences between cases where the modelcompletes the two-hop query correctly and incor-rectly. Therefore we generate two dataset subsetsper model for these cases accordingly.The first subset is made up of cases where themodel correctly answers both the two-hop queryand the first hop. For example, given the two-hopquery “The spouse of the performer of Imagineis”, we verify that the model correctly predicts theanswer Yoko Ono when prompted with the two-hop query and additionally correctly predicts JohnLennon when prompted with the first hop “Theperformer of Imagine is”. We use the latter filterto make sure that the model indeed “knows” theanswer to the first hop. We then randomly sample100 examples of each bridge entity type, in orderto create a more balanced subset (if less than 100examples of a specific type exist we take them all).The second subset includes cases where themodel correctly answers both the first and secondhop in isolation, but fails to answer the full two-hopquery. As an example for the filtering procedure,given the same query above, we verify that themodel correctly predicts John Lennon for the firsthop “The performer of Imagine is” and Yoko Onofor the second hop “The spouse of John Lennonis”, but fails to predict Yoko Ono for the two-hopquery “The spouse of the performer of Imagine is”.We focus on these cases, because we are interestedin understanding why answering the two-hop queryfails despite the model “knowing” the two separatefacts. As we show later, this failure is likely dueto the first fact being resolved too late. In a sim-ilar fashion to the first setting, we then randomlysample 50 examples of each bridge entity type (inorder to keep the correct and incorrect subsets ofapproximately the same size).Table 1 reports the amount of examples used inexperiments by model and setting.14115
[[PDF PAGE 4]]2.3 ModelsWe analyze the following models: LLaMA 2 7Band 13B (Touvron et al., 2023), LLaMA 3 8B and70B (Meta AI, 2024), and Pythia 6.9B and 12B(Biderman et al., 2023). The 6.9B, 7B and 8Bmodels have 32 layers, the 12B model has 36 layers,the 13B model has 40 layers, and the 70B modelhas 80 layers.3 Localizing First Hop ResolutionOne could imagine several possible ways for amodel to solve multi-hop queries. One such waywould be to effectively treat the two-hop query as asingle relation, enabling the extraction of the finalanswer without the need to recall e2. Despite this,if the model truly performs latent reasoning, themost intuitive way to do so would start by resolvingthe first hop at some point within the computation.In order to localize where this happens, we usethe Patchscopes analysis method. Our results showthat the model indeed resolves the first hop duringthe early layers, at the position of t1.3.1 Interpreting Hidden RepresentationsWe use the Patchscopes framework (Ghandehar-ioun et al., 2024) to create a task that describesthe entity encoded in a specific hidden representa-tion. Patchscopes maps a given representation toa sentence in natural language, thus considerablyextending vocabulary projections which map to asingle token (nostalgebraist, 2020).The procedure is as follows. First, given a sourceprompt, a source token and a source layer, thesource prompt is passed through the model’s for-ward computation and the hidden representation vof the source token at the source layer is recorded.This representation v is what we aim to probe insearch for an encoded entity. Second, we passthe same prompt used by Ghandeharioun et al.(2024): “Syria: Syria is a country in theMiddle East, Leonardo DiCaprio: LeonardoDiCaprio is an American actor, Samsung:Samsung is a South Korean multinationalcorporation, x” through the model, replacingthe hidden representation of“x” with v at a specifictarget layer. Finally, the forward pass is continuedand text is generated.The chosen target prompt encourages the modelto generate a continuation that states the seman-tic content (i.e., the entity name) encoded in thesource hidden representation, along with a shortModel Subset e2 from t1 e2 from t2 e3 from t2Cases Layer Cases Layer Cases LayerLLaMA 2 Corr. 56% 8 .9 41% 15 .3 73% 16 .27B Incorr. 41% 9 .1 36% 16 .4 47% 17 .5LLaMA 2 Corr. 49% 7 .7 34% 18 .2 71% 16 .913B Incorr. 48% 7 .4 37% 17 .9 33% 16 .9LLaMA 3 Corr. 46% 8 .9 37% 14 .3 74% 13 .58B Incorr. 46% 11 .9 25% 15 .3 40% 17 .2LLaMA 3 Corr. 63% 27 .1 46% 35 .2 86% 30 .770B Incorr. 57% 29 .2 46% 34 .5 50% 35 .9Pythia Corr. 75% 5 .4 75% 11 .4 80% 14 .16.9B Incorr. 78% 4 .9 67% 9 .2 65% 13 .6Pythia Corr. 73% 5 .0 66% 12 .2 77% 13 .512B Incorr. 61% 6 .3 42% 12 .9 52% 17 .2Table 2: The results of Patchscopes executions. Thetable reports the percentage of cases where a targetentity was successfully decoded from a source position.The table additionally reports the mean of the layerwhere the target entity was first successfully decoded.description of it. We find this task is better fittingthan other proposed probes such as vocabulary pro-jections (nostalgebraist, 2020; Geva et al., 2022) ortraining linear classifiers on hidden representations(Belinkov and Glass, 2019; Belinkov, 2022). Thisis because exhibiting the ability to extract informa-tion from a hidden representation gives reason tobelieve that the same information can be extractedwhen answering the two-hop query. In additionPatchscopes has the clear advantage of decoding arepresentation into a natural language description.3.2 ExperimentWe run Patchscopes on t1, recording the hiddenrepresentation at each source layer and then patch-ing it into all target layers. Following each patchwe sample three generations. For each source layerwe check whether one of the generations is of e2,and if so, we consider the representation to encodethe bridge entity at the source layer.3.3 ResultsTable 2 presents the percentage of cases where e2was observed in the hidden representation of t1.We refer to these as cases where e2 was success-fully resolved. We note the non-trivial percentagesof 41%-78% across all models and settings. Ad-ditionally, we note the general drop in resolvedcases when the model fails to correctly completethe two-hop query, but that this setting still dis-plays a surprisingly high success rate. Next, weexamine the mean layer at which e2 first appears14116
[[PDF PAGE 5]]/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni00000016/uni00000018/uni00000017/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000014/uni00000015/uni00000016/uni00000017/uni00000018/uni00000019/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2Figure 2: Percentage of cases per layer where target en-tities were first successfully decoded using Patchscopes.The percentages are out of all correctly answered casesfor LLaMA 2 13B.0 8 16 24 32T arget Layer08162432Source Layer01234567Figure 3: Heat-map of the layers where Patchscopessuccessfully decodes e2 from the position of t1. The per-centages are out of all successful decodings for LLaMA2 13B run on correctly answered cases.in both correct and incorrect cases. We find thatin the incorrect cases the resolving generally oc-curs at higher layers than those of the correct cases.This difference alludes to how early the resolvinghappens potentially playing a part in successfullyanswering two-hop queries. We further verify thisusing the back-patching analysis method in §6.Figure 2 displays the proportion of cases perlayer where e2 is first successfully decoded from t1using Patchscopes. We observe that the resolvingoccurs almost exclusively during the early layers.Interestingly, this implies that the knowledge re-quired for this resolution must reside in these ear-lier layers. Similar figures for additional modelsare provided in Appendix B. The plot additionallyshows the curve regarding the resolving of e3 fromt2, which is discussed in §4.This finding can further be seen in Figure 3,which displays a heat-map of the layers wherePatchscopes successfully decodes e2 from t1. Twohot-spots are apparent. The first corresponds tosuccess cases with an early source layer, showingthat e2 generally appears at this position during theearly layers. The second hot-spot corresponds tolater source layers that display success almost ex-clusively when patched after the final layer, whichis roughly equivalent to vocabulary projection (nos-talgebraist, 2020). This is a clear advantage ofPatchscopes, as despite the entity not being amongthe top tokens in the projection during early layers,it is in fact encoded in the hidden representation.See Appendix C for heat-maps of all models.4 Second Hop is Resolved at Last PositionIn §3, we observe that the first hop is often resolvedin position t1. Intuitively, one would expect thecomputation to use this result towards resolving thesecond hop (i.e., the final answer). In this section,we study this proposition by finding where e3 firstemerges and how it relates to the first emergenceof e2. We find that e3 indeed emerges predomi-nantly after e2 at the position of t2. Furthermore,we search for the final part of the pathway, the pre-dicted token. By projecting the residual updatesmade by the attention and MLP sublayers on thehidden representation of t2, we find that the MLPsublayers play the larger part in conjuring the pre-dicted token.4.1 MethodPrevious works (Geva et al., 2022, 2023) haveshown that the residual updates made by the MLPand attention sublayers can be interpreted by pro-jecting them to the vocabulary using the layer normand output embedding matrix. We use this methodin order to locate specific entities in the flow ofinformation by observing the rank of the entityin the vocabulary projection. We additionally usePatchscopes as presented in §3.4.2 ExperimentWe first employ Patchscopes on t2, this time check-ing if the target entity e3 is encoded at this position.Additionally, we project the sublayer updates per-formed on t2, and check if the token with the high-est probability in the projection is the first tokenof the generated text. If so, we conclude that theupdate of a particular sublayer promotes the finalprediction.14117
[[PDF PAGE 6]]Model Subset Attention MLPCases Layer Cases LayerLLaMA 2 7B Correct 25.5% 24 .7 33 .2% 25 .2Incorrect 14.8% 23 .4 28 .4% 26 .0LLaMA 2 13B Correct 28.8% 32 .0 68 .5% 33 .1Incorrect 14.2% 27 .0 51 .5% 31 .7LLaMA 3 8B Correct 9.7% 26 .7 17 .6% 27 .8Incorrect 25.3% 27 .4 11 .8% 24 .6LLaMA 3 70B Correct 21.9% 56 .3 48 .1% 68 .0Incorrect 21.8% 65 .7 36 .1% 67 .0Pythia 6.9B Correct 11.5% 21 .8 36 .4% 20 .5Incorrect 28.2% 23 .4 33 .6% 21 .2Pythia 12B Correct 27.9% 22 .2 38 .9% 22 .4Incorrect 43.2% 23 .6 47 .0% 23 .3Table 3: Percentages and mean layers where for the firsttime the predicted token is the most probable token inthe vocabulary projection of the sublayer update.4.3 ResultsTable 2 contains the percentage of cases e3 was de-coded from t2, effectively resolving the second hop.As expected, these percentages are high for cases inwhich the model predicted correctly (71%-86%)3and low for cases the model predicted incorrectly(33%-65%). Additionally, it is apparent from bothTable 2 and Figure 2 that the target entity is re-solved by the mid-upper layers at the position oft2. This suggests that the information required toperform the second hop exists in the parameters ofthese layers.Inspecting the sublayer projections in Table 3,we find that the MLP sublayers play a larger rolein promoting the predicted token compared tothat of the attention sublayers. Despite this, thenon negligible percentages achieved by the atten-tion sublayers could suggest multiple pathways, inagreement with previous work (Geva et al., 2023;Merullo et al., 2024) that considered both possi-bilities. Looking at the mean layers at which theprediction is first promoted, one can see that thesepromotions occur in the upper layers, after the lasttoken has been resolved to e3.5 Information Propagates to Last TokenAs the model’s prediction is emitted from the lastposition of the prompt, critical information regard-ing the bridge entity must propagate to this token.By using attention knockout, projection, and Patch-scopes, we verify this claim. We find that in a large3We attribute the gap from 100% to the approximationsinvolved in decoding a hidden representation.majority of cases relevant information can indeedbe detected passing from t1 to t2.5.1 MethodIn similar fashion to previous work (Wang et al.,2023b; Geva et al., 2023), we block hidden repre-sentations from attending to other representationsat specific layers and test if the model’s final gener-ation changes. We perform the knockout by settingthe mask of the attention from a source to a targetposition at a specific layer to−∞, causing this at-tention edge to contribute nothing to the residualupdate performed on the source representation. Weexperiment with blocking a window of layers asprevious work (Geva et al., 2023) shows that in-formation propagation is spread among multiplelayers.We additionally employ Patchscopes and sub-layer vocabulary projections, as described in §3and §4 respectively.5.2 ExperimentWe run attention knockout blocking informationoriginating at t1 from propagating to t2. We block awindow of 7 layers in order to capture informationflowing through multiple layers. If blocking a setof layers causes the model to no longer correctlypredict the answer (in the incorrect setting we checkfor a change in the generated text), we considerthese layers to contain information critical to theprediction.We additionally project the updates made by theattention and MLP sublayers to the last token, asdescribed in §4. In the vocabulary projection wecheck if e2 is the token with the highest probability,and if so consider the update to “contain” the bridgeentity.Finally, we run Patchscopes on the last token ofthe prompt, as done in §3, checking ife2 is encodedin t2. Each one of these experiments gives a uniquesignal that information must have propagated fromt1 to t2.5.3 ResultsTable 4 shows the percentage of cases where wedetect critical information propagating fromt1 to t2using at least one of the methods stated above. Wenote the relatively high percentages, indicating theinformation indeed flows as expected. Additionally,the table shows the that the layers relevant to thepropagation are mostly the middle layers.14118
[[PDF PAGE 7]]Model Subset Detected Mean LayerLLaMA 2 7B Correct 85.82% 12 .83Incorrect 95.44% 8 .10LLaMA 2 13B Correct 81.94% 15 .45Incorrect 71.11% 16 .99LLaMA 3 8B Correct 78.36% 10 .15Incorrect 82.74% 7 .45LLaMA 3 70B Correct 90.39% 29 .14Incorrect 94.28% 20 .06Pythia 6.9B Correct 96.53% 11 .94Incorrect 95.04% 8 .06Pythia 12B Correct 94.18% 11 .23Incorrect 93.81% 9 .28Table 4: Percentages and mean layers of cases wherecritical information was first detected propagating fromt1 to t2 using attention knockout, projection, or Patch-scopes.Table 2 contains the percentage of cases e2 wasdecoded from t2, showing that this position indeedrepresents the bridge entity in 25%-75% of allcases. Comparing between the results of Patch-scopes on t2 to those on t1, we observe a starkdifference in the successful source layers. The re-sults show that the t2 first encodes e2 during themid-upper layers, while t1 does so in the lowerlayers. This can further be seen in the Patchscopesheat-maps in Appendix C. This gives additionalreason to believe that a sequential computation istaking place.After describing all major pathway stages, weturn to a comparison between the correct and in-correct cases and observe the following pattern.Generally, in incorrect cases, the entities seem tobe resolved later while the information seems topropagate and be extracted earlier. Figure 4 dis-plays this pattern in LLaMA 3 8B, plotting the firstobserved layers of each stage (we refer to AppendixD for plots of additional models). This gives evi-dence of the importance of how early the first hopis resolved.6 Back-patching Improves Two-HopPerformanceOur results consistently display a sequential na-ture of computation, where the first hop is resolvedinto the bridge entity by the lower layers, which isthen used to answer the second hop in the upperlayers. These results suggest that when answeringtwo-hop queries fail, it could be because the first-hop is resolved at layers that no longer contain the/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057Figure 4: A comparison of the first layers of each stagein the pathway between correct and incorrect cases forLLaMA 3 8B.information needed to resolve the second hop. Inorder to verify this hypothesis, we test the follow-ing intriguing conjecture. We know that the earlierlayers certainly contain knowledge, since they areregularly used to resolve the first hop. Then, weask what will happen if we take a hidden represen-tation from a later layer and “feed” it into theseearlier layers. Will the correct information now beextracted? As our results next show, this is oftenthe case. This “back-patching” analysis thus pro-vides strong support that the success in two hopqueries require the later layers to have the samefunctionality as earlier ones.Overall, this could point to an inherent limitationof the transformer architecture, where the model“runs out” of layers, propagates and extracts infor-mation before it is fully resolved, or is forced touse only the upper layers for knowledge extraction.6.1 MethodFollowing our intuition above, we perform the fol-lowing back-patching experiment. Given a prompt,we first record a hidden representation v from asource layer ℓs. Then, while rerunning the sameprompt, we patch v into the same position at a tar-get layer ℓt such that ℓt < ℓ s. The forward passthen continues and text is generated using greedydecoding. This effectively feeds ℓt with informa-tion encoded in v that originated in ℓs.14119
[[PDF PAGE 8]]0 8 16 24 32T arget Layer08162432Source Layer012345678(a) Back-patching t10 8 16 24 32T arget Layer08162432Source Layer01234567 (b) Back-patching t2Figure 5: Heat-map of the layers where back-patching succeeds. The percentages are out of all successful back-patching instances for LLaMA 2 13B.Model Subset t1 t2LLaMA 2 7B Correct 100% 100%Incorrect 41.02% 42 .45%LLaMA 2 13B Correct 100% 100%Incorrect 32.44% 36 .07%LLaMA 3 8B Correct 100% 100%Incorrect 38.81% 47 .16%LLaMA 3 70B Correct 100% 100%Incorrect 57.31% 57 .81%Pythia 6.9B Correct 100% 100%Incorrect 66.33% 56 .43%Pythia 12B Correct 100% 100%Incorrect 63.17% 61 .82%Table 5: Back-patching success rates by setting andback-patched token.6.2 ExperimentWe perform the back-patching experiment twice,once on the token t1 and once on the token t2. Inorder to quantify the potential of back-patching,we check whether one of the source-target pairsresulted in the generation of the correct answer. Wethen perform an analysis of the successful sourceand target layers.6.3 ResultsTable 5 presents the back-patching results. Firstwe note the high success rates, correctly answeringbetween 32%-66% of incorrect cases while keepingthe correct cases at 100% across models and tokenpositions. This means that in many cases rerunningspecific parts of the computation is enough in orderto successfully extract the target information. On amore practical note, this also shows that significantgains can be made by correctly choosing the sourceand target layers, which we leave for future work.One can additionally observe that in LLaMAmodels back-patching t2 achieves a higher successrate than back-patching t1, which may point at thestages related to the last position of the prompt asbeing the more dominant failure point in answeringtwo-hop queries. Moreover, this higher successrate is achieved despite the fact that back-patchingt2 does not assume any information about the struc-ture of the prompt. We believe that this displays anadditional strength of the method.Figure 5a displays the heat-map of the layerswhere back-patching t1 succeeds for LLaMA 213B (see Appendix E for additional models). Wefirst note the higher success rate when the sourcelayers are the model’s lower layers. These lowerlayers correlate to the resolving of the first hop,therefore back-patching them allows the model abetter chance at solving the first hop. Second, wenote the non existent success rate of the highertarget layers. Unsurprisingly, in this case the modeldoes not gain enough time to correctly completethe pathway, resulting in a low success rate.Figure 5b displays the heat-map of the layerswhere back-patching t2 succeeds for LLaMA 213B. Unlike when back-patching t1, in this casethe higher success rate can be found in the the up-per source layers. These layers correlate to theresolving of the second hop at the last token posi-tion. Hence, back-patching a hidden representationtaken from a later layer allows the model a betterchance at solving the second hop. Furthermore, wenote the higher success rate in lower target layers.This allows the model to gain time to resolve thesecond hop. This also gives the model access toparametric knowledge that might only be encodedin the lower layers, allowing the model to fullyutilize its whole knowledge-base.14120
[[PDF PAGE 9]]7 Related WorkTracing and locating factual knowledge has beenthe focus of many recent works aiming to under-cover and control the way transformers make pre-dictions. Several of these works are motivated byknowledge editing (De Cao et al., 2021; Mitchellet al., 2022; Meng et al., 2022; Zhang et al., 2024)while others focus on understanding the inner work-ings of transformers (Dai et al., 2022; Geva et al.,2022, 2023). Our work follows and expands onthis second group by extending them to the morecomplex case of two-hop queries, which requiremultiple factual knowledge extractions and compo-sitions.The question whether models can implicitly rea-son over stored parametric knowledge has alsogained recent popularity. One avenue of relatedresearch includes circuit discovery (Nanda et al.,2023; Wang et al., 2023b; Conmy et al., 2023;Brinkmann et al., 2024), but these works focusmainly on synthetic tasks. More closely related tothis paper, recent works (Sakarvadia et al., 2023;Yang et al., 2024; Li et al., 2024a) have found ex-istential evidence of latent reasoning in multi-hopqueries, albeit without accounting for the flow ofinformation throughout layers and positions. In aconcurrent work by Wang et al. (2024) a multi-hopreasoning circuit similar to ours was discovered ina small transformer language model trained on syn-thetic data until grokking occurs. Our work findsfurther proof of such latent reasoning in a morepractical setting that includes large language mod-els, real world knowledge and a regular pretrainingsetup. We additionally use different mechanisticinterpretability methods and account for the flowof information during the forward pass.Even without fully identifying the mechanismbehind latent reasoning, several works have triedto address model’s shortcomings in this area. Onesuch work by Sakarvadia et al. (2023) assumesprior knowledge of the bridge entity, whose hiddenrepresentation is then strategically injected directlyinto the computation. Likewise, recent work by Liet al. (2024a) also assumes knowledge of the bridgeentity and then employs knowledge editing tech-niques to improve performance, which is knownto have potentially disruptive effects on models(Zhang et al., 2024; Hsueh et al., 2024; Li et al.,2024b). Both these previously proposed methodshave drawbacks, which a potential method basedon back-patching would not share.8 ConclusionOur work uses mechanistic tools to study the latentreasoning abilities of LLMs on two hop queries.We observe strong evidence of a sequential latentreasoning pathway in which the second hop is an-swered in the mid-upper layers only after the firsthop is answered by the lower layers. We find thatthis sequential nature could point to a possible lim-itation of transformers, where the second hop mustbe answered using only the knowledge encodedin the upper layers. To further validate this, weintroduce and evaluate an analysis method namedback-patching, based on extracting hidden repre-sentations from later layers and patching them backinto earlier layers. Finally, we show that back-patching significantly improves performance onpreviously incorrect queries. Overall, our methodsand findings open opportunities for understandingand improving latent reasoning in LLMs.LimitationsSeveral of our experiments rely on mechanisticmethods that decode hidden representations andresidual updates in various ways. While these meth-ods have been widely used in many recent works(Geva et al., 2022, 2023; Dar et al., 2023; Yanget al., 2024; Li et al., 2024a), they can only beseen as an approximation. However, using multi-ple different techniques (such as both Patchscopesand sublayer projections) helps alleviate this con-cern. Additionally, our experiments are generallydesigned to give positive signals that result in lowerbound results, hence we believe that these approxi-mations do not undermine our findings.In this work we study one prominent latent rea-soning pathway, although others most likely exist(McGrath et al., 2023; Yang et al., 2024). Addition-ally, we do not account for all possible parts of thediscovered pathway (e.g., how the relations comein to play). Despite this, by focusing on the mostrelevant components we find sufficient proof forour main finding regarding the sequential nature ofthe computation.Our work examines only two-hop queries, al-though we expect queries with three or morehops and even additional unrelated reasoning tasksto involve similar mechanisms to those we ob-served. This is due to previous (Wang et al., 2023b;Brinkmann et al., 2024) and concurrent (Wanget al., 2024) works in different (if sometimes smallor synthetic) settings observing pathways that can14121
[[PDF PAGE 10]]be broken down into concrete computational stepsthat match intuitive reasoning steps. These resultsresemble our finding that two-hop questions arebroken down and answered sequentially by LLMs.We leave such expansion to additional settings forfuture work.Despite the promising results of back-patching,our current proposed method is not a practical in-ference method, as only a subset of back-patchesgenerate the correct answer. However, if one couldefficiently select a subset of source and target lay-ers a priori, this could make for a viable method.Although we believe that if achieving the best per-formance in multi-hop question answering is thesole goal, methods such as chain of thought prompt-ing (Wei et al., 2022; Press et al., 2023) would befar more effective.AcknowledgementsThis work was supported by the Tel Aviv UniversityCenter for AI and Data Science (TAD) and theIsraeli Science Foundation.ReferencesDavid Bau. 2024. Baukit.Yonatan Belinkov. 2022. Probing classifiers: Promises,shortcomings, and advances. Computational Linguis-tics, 48(1):207–219.Yonatan Belinkov and James Glass. 2019. Analysismethods in neural language processing: A survey.Transactions of the Association for ComputationalLinguistics, 7:49–72.Stella Biderman, Hailey Schoelkopf, Quentin GregoryAnthony, Herbie Bradley, Kyle O’Brien, Eric Hal-lahan, Mohammad Aflah Khan, Shivanshu Purohit,USVSN Sai Prashanth, Edward Raff, et al. 2023.Pythia: A suite for analyzing large language mod-els across training and scaling. In InternationalConference on Machine Learning, pages 2397–2430.PMLR.Jannik Brinkmann, Abhay Sheshadri, Victor Levoso,Paul Swoboda, and Christian Bartelt. 2024. A mech-anistic analysis of a transformer trained on a symbolicmulti-step reasoning task. In Findings of the Associa-tion for Computational Linguistics ACL 2024, pages4082–4102, Bangkok, Thailand and virtual meeting.Association for Computational Linguistics.Roi Cohen, Eden Biran, Ori Yoran, Amir Globerson,and Mor Geva. 2024. Evaluating the ripple effectsof knowledge editing in language models. Transac-tions of the Association for Computational Linguis-tics, 12:283–298.Arthur Conmy, Augustine Mavor-Parker, Aengus Lynch,Stefan Heimersheim, and Adrià Garriga-Alonso.2023. Towards automated circuit discovery for mech-anistic interpretability. In Advances in Neural Infor-mation Processing Systems, volume 36, pages 16318–16352. Curran Associates, Inc.Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, BaobaoChang, and Furu Wei. 2022. Knowledge neurons inpretrained transformers. In Proceedings of the 60thAnnual Meeting of the Association for ComputationalLinguistics (Volume 1: Long Papers), pages 8493–8502, Dublin, Ireland. Association for ComputationalLinguistics.Guy Dar, Mor Geva, Ankit Gupta, and Jonathan Berant.2023. Analyzing transformers in embedding space.In Proceedings of the 61st Annual Meeting of theAssociation for Computational Linguistics (Volume 1:Long Papers), pages 16124–16170, Toronto, Canada.Association for Computational Linguistics.Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021. Edit-ing factual knowledge in language models. In Pro-ceedings of the 2021 Conference on Empirical Meth-ods in Natural Language Processing , pages 6491–6506, Online and Punta Cana, Dominican Republic.Association for Computational Linguistics.Nouha Dziri, Ximing Lu, Melanie Sclar, Xiang (Lor-raine) Li, Liwei Jiang, Bill Yuchen Lin, Sean Welleck,Peter West, Chandra Bhagavatula, Ronan Le Bras,Jena Hwang, Soumya Sanyal, Xiang Ren, Allyson Et-tinger, Zaid Harchaoui, and Yejin Choi. 2023. Faithand fate: Limits of transformers on compositional-ity. In Advances in Neural Information ProcessingSystems, volume 36, pages 70293–70332. Curran As-sociates, Inc.Mor Geva, Jasmijn Bastings, Katja Filippova, and AmirGloberson. 2023. Dissecting recall of factual associa-tions in auto-regressive language models. InProceed-ings of the 2023 Conference on Empirical Methods inNatural Language Processing, pages 12216–12235,Singapore. Association for Computational Linguis-tics.Mor Geva, Avi Caciularu, Kevin Wang, and Yoav Gold-berg. 2022. Transformer feed-forward layers buildpredictions by promoting concepts in the vocabularyspace. In Proceedings of the 2022 Conference onEmpirical Methods in Natural Language Process-ing, pages 30–45, Abu Dhabi, United Arab Emirates.Association for Computational Linguistics.Mor Geva, Roei Schuster, Jonathan Berant, and OmerLevy. 2021. Transformer feed-forward layers are key-value memories. In Proceedings of the 2021 Confer-ence on Empirical Methods in Natural Language Pro-cessing, pages 5484–5495, Online and Punta Cana,Dominican Republic. Association for ComputationalLinguistics.Asma Ghandeharioun, Avi Caciularu, Adam Pearce, Lu-cas Dixon, and Mor Geva. 2024. Patchscopes: A14122
[[PDF PAGE 11]]unifying framework for inspecting hidden representa-tions of language models. In Forty-first InternationalConference on Machine Learning.Yifan Hou, Jiaoda Li, Yu Fei, Alessandro Stolfo,Wangchunshu Zhou, Guangtao Zeng, Antoine Bosse-lut, and Mrinmaya Sachan. 2023. Towards a mech-anistic interpretation of multi-step reasoning capa-bilities of language models. In Proceedings of the2023 Conference on Empirical Methods in NaturalLanguage Processing, pages 4902–4919, Singapore.Association for Computational Linguistics.Cheng-Hsun Hsueh, Paul Kuo-Ming Huang, Tzu-HanLin, Che-Wei Liao, Hung-Chieh Fang, Chao-WeiHuang, and Yun-Nung Chen. 2024. Editing themind of giants: An in-depth exploration of pitfalls ofknowledge editing in large language models. arXivpreprint arXiv:2406.01436.Tianjie Ju, Yijin Chen, Xinwei Yuan, Zhuosheng Zhang,Wei Du, Yubin Zheng, and Gongshen Liu. 2024. In-vestigating multi-hop factual shortcuts in knowledgeediting of large language models. In Proceedingsof the 62nd Annual Meeting of the Association forComputational Linguistics (Volume 1: Long Papers),pages 8987–9001, Bangkok, Thailand. Associationfor Computational Linguistics.Brenden Lake and Marco Baroni. 2018. Generalizationwithout systematicity: On the compositional skillsof sequence-to-sequence recurrent networks. In Pro-ceedings of the 35th International Conference onMachine Learning, volume 80 of Proceedings of Ma-chine Learning Research, pages 2873–2882. PMLR.Zhaoyi Li, Gangwei Jiang, Hong Xie, Linqi Song, DefuLian, and Ying Wei. 2024a. Understanding and patch-ing compositional reasoning in LLMs. In Findings ofthe Association for Computational Linguistics ACL2024, pages 9668–9688, Bangkok, Thailand and vir-tual meeting. Association for Computational Linguis-tics.Zhoubo Li, Ningyu Zhang, Yunzhi Yao, Mengru Wang,Xi Chen, and Huajun Chen. 2024b. Unveiling the pit-falls of knowledge editing for large language models.In The Twelfth International Conference on LearningRepresentations.Thomas McGrath, Matthew Rahtz, Janos Kramar,Vladimir Mikulik, and Shane Legg. 2023. The hy-dra effect: Emergent self-repair in language modelcomputations. arXiv preprint arXiv:2307.15771.Kevin Meng, David Bau, Alex Andonian, and YonatanBelinkov. 2022. Locating and editing factual asso-ciations in gpt. In Advances in Neural InformationProcessing Systems, volume 35, pages 17359–17372.Curran Associates, Inc.Jack Merullo, Carsten Eickhoff, and Ellie Pavlick. 2024.Language models implement simple Word2Vec-stylevector arithmetic. In Proceedings of the 2024 Con-ference of the North American Chapter of the Asso-ciation for Computational Linguistics: Human Lan-guage Technologies (Volume 1: Long Papers), pages5030–5047, Mexico City, Mexico. Association forComputational Linguistics.Meta AI. 2024. Introducing meta llama 3: The mostcapable openly available llm to date.Eric Mitchell, Charles Lin, Antoine Bosselut, ChelseaFinn, and Christopher D Manning. 2022. Fast modelediting at scale. In International Conference onLearning Representations.Neel Nanda, Lawrence Chan, Tom Lieberum, JessSmith, and Jacob Steinhardt. 2023. Progress mea-sures for grokking via mechanistic interpretability. InThe Eleventh International Conference on LearningRepresentations.nostalgebraist. 2020. interpreting gpt: the logit lens.Yasumasa Onoe, Michael Zhang, Shankar Padmanab-han, Greg Durrett, and Eunsol Choi. 2023. Can LMslearn new entities from descriptions? challenges inpropagating injected knowledge. In Proceedingsof the 61st Annual Meeting of the Association forComputational Linguistics (Volume 1: Long Papers),pages 5469–5485, Toronto, Canada. Association forComputational Linguistics.Jackson Petty, Sjoerd Steenkiste, Ishita Dasgupta, FeiSha, Dan Garrette, and Tal Linzen. 2024. The impactof depth on compositional generalization in trans-former language models. In Proceedings of the 2024Conference of the North American Chapter of theAssociation for Computational Linguistics: HumanLanguage Technologies (Volume 1: Long Papers) ,pages 7239–7252, Mexico City, Mexico. Associationfor Computational Linguistics.Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt,Noah Smith, and Mike Lewis. 2023. Measuring andnarrowing the compositionality gap in language mod-els. In Findings of the Association for ComputationalLinguistics: EMNLP 2023, pages 5687–5711, Singa-pore. Association for Computational Linguistics.Mansi Sakarvadia, Aswathy Ajith, Arham Khan, DanielGrzenda, Nathaniel Hudson, André Bauer, KyleChard, and Ian Foster. 2023. Memory injections:Correcting multi-hop reasoning failures during in-ference in transformer-based language models. InProceedings of the 6th BlackboxNLP Workshop: An-alyzing and Interpreting Neural Networks for NLP,pages 342–356, Singapore. Association for Compu-tational Linguistics.Hugo Touvron, Louis Martin, Kevin Stone, Peter Al-bert, Amjad Almahairi, Yasmine Babaei, NikolayBashlykov, Soumya Batra, Prajjwal Bhargava, ShrutiBhosale, et al. 2023. Llama 2: Open founda-tion and fine-tuned chat models. arXiv preprintarXiv:2307.09288.Denny Vrandeˇci´c and Markus Krötzsch. 2014. Wiki-data: a free collaborative knowledgebase. Commun.ACM, 57(10):78–85.14123
[[PDF PAGE 12]]Boshi Wang, Xiang Yue, Yu Su, and Huan Sun. 2024.Grokked transformers are implicit reasoners: A mech-anistic journey to the edge of generalization. arXivpreprint arXiv:2405.15071.Fei Wang, Wenjie Mo, Yiwei Wang, Wenxuan Zhou,and Muhao Chen. 2023a. A causal view of entitybias in (large) language models. In Findings of theAssociation for Computational Linguistics: EMNLP2023, pages 15173–15184, Singapore. Associationfor Computational Linguistics.Kevin Ro Wang, Alexandre Variengien, Arthur Conmy,Buck Shlegeris, and Jacob Steinhardt. 2023b. Inter-pretability in the wild: a circuit for indirect objectidentification in GPT-2 small. In The Eleventh Inter-national Conference on Learning Representations.Jason Wei, Xuezhi Wang, Dale Schuurmans, MaartenBosma, brian ichter, Fei Xia, Ed H. Chi, Quoc V Le,and Denny Zhou. 2022. Chain of thought prompt-ing elicits reasoning in large language models. InAdvances in Neural Information Processing Systems.Thomas Wolf, Lysandre Debut, Victor Sanh, JulienChaumond, Clement Delangue, Anthony Moi, Pier-ric Cistac, Tim Rault, Remi Louf, Morgan Funtow-icz, Joe Davison, Sam Shleifer, Patrick von Platen,Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu,Teven Le Scao, Sylvain Gugger, Mariama Drame,Quentin Lhoest, and Alexander Rush. 2020. Trans-formers: State-of-the-art natural language processing.In Proceedings of the 2020 Conference on EmpiricalMethods in Natural Language Processing: SystemDemonstrations, pages 38–45, Online. Associationfor Computational Linguistics.Nan Xu, Fei Wang, Bangzheng Li, Mingtao Dong, andMuhao Chen. 2022. Does your model classify en-tities reasonably? diagnosing and mitigating spuri-ous correlations in entity typing. In Proceedings ofthe 2022 Conference on Empirical Methods in Nat-ural Language Processing, pages 8642–8658, AbuDhabi, United Arab Emirates. Association for Com-putational Linguistics.Sohee Yang, Elena Gribovskaya, Nora Kassner, MorGeva, and Sebastian Riedel. 2024. Do large languagemodels latently perform multi-hop reasoning? InProceedings of the 62nd Annual Meeting of the As-sociation for Computational Linguistics (Volume 1:Long Papers), pages 10210–10229, Bangkok, Thai-land. Association for Computational Linguistics.Ningyu Zhang, Yunzhi Yao, Bozhong Tian, Peng Wang,Shumin Deng, Mengru Wang, Zekun Xi, ShengyuMao, Jintian Zhang, Yuansheng Ni, et al. 2024. Acomprehensive study of knowledge editing for largelanguage models. arXiv preprint arXiv:2401.01286.Zexuan Zhong, Zhengxuan Wu, Christopher Manning,Christopher Potts, and Danqi Chen. 2023. MQuAKE:Assessing knowledge editing in language models viamulti-hop questions. In Proceedings of the 2023Conference on Empirical Methods in Natural Lan-guage Processing, pages 15686–15702, Singapore.Association for Computational Linguistics.A Technical DetailsWe use the Baukit library (Bau, 2024) for severalof the experiments. Each experiment was run on1-4 A100 or H100 GPUs and lasted at most 24hours. The models were retrieved and run usingthe HuggingFace Transformers library (Wolf et al.,2020). When generating with sampling we use thedefault parameters from the Transformers library.We use half precision for the 70B model and fullprecision for all other models.B Patchscopes First Decoded LayersFigure 6 depicts the percentage of cases per layerwhere target entities were first successfully de-coded using Patchscopes for all models (as de-scribed in §3).C Patchscopes Heat-mapsFigures 7 and 8 depict the heat-maps of Patchscopesuccess cases as introduced in §3. We report Patch-scope experiments for decodinge2 from t1, e2 fromt2, and e3 from t2 for all models.D First Observed Layers of PathwayStagesFigure 9 depicts a comparison of the first layers ofeach stage in the observed pathway between correctand incorrect cases (as shown in §5) for all models.E Back-patching Heat-mapsFigures 10 and 11 depict the back-patching heap-maps of successful source and target layers (asshown in §6) for all models.14124
[[PDF PAGE 13]]/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000015/uni00000017/uni00000019/uni0000001b/uni00000014/uni00000013/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2(a) LLaMA 2 7B/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni00000016/uni00000018/uni00000017/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000014/uni00000015/uni00000016/uni00000017/uni00000018/uni00000019/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2 (b) LLaMA 2 13B/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000014/uni00000015/uni00000016/uni00000017/uni00000018/uni00000019/uni0000001a/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2(c) LLaMA 3 8B/uni00000013/uni00000014/uni00000013/uni00000015/uni00000013/uni00000016/uni00000013/uni00000017/uni00000013/uni00000018/uni00000013/uni00000019/uni00000013/uni0000001a/uni00000013/uni0000001b/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000014/uni00000015/uni00000016/uni00000017/uni00000018/uni00000019/uni0000001a/uni0000001b/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2 (d) LLaMA 3 70B/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000015/uni00000017/uni00000019/uni0000001b/uni00000014/uni00000013/uni00000014/uni00000015/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2(e) Pythia 6.9B/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni00000016/uni00000018/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000013/uni00000015/uni00000017/uni00000019/uni0000001b/uni00000033/uni00000048/uni00000055/uni00000046/uni00000048/uni00000051/uni00000057/uni00000044/uni0000004a/uni00000048/uni00000003/uni00000052/uni00000049/uni00000003/uni00000026/uni00000044/uni00000056/uni00000048/uni00000056e2/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t1 e3/uni00000003/uni00000047/uni00000048/uni00000046/uni00000052/uni00000047/uni00000048/uni00000047/uni00000003/uni00000049/uni00000055/uni00000052/uni00000050/uni00000003t2 (f) Pythia 12BFigure 6: Percentage of cases per layer where target entities were first successfully decoded using Patchscopes.14125
[[PDF PAGE 14]]0 8 16 24T arget Layer081624Source Layer012345678(a) e2 decoded from t1, LLaMA 2 7B0 8 16 24T arget Layer081624Source Layer02468 (b) e2 decoded from t2, LLaMA 2 7B0 8 16 24T arget Layer081624Source Layer0510152025 (c) e3 decoded from t2, LLaMA 2 7B0 8 16 24 32T arget Layer08162432Source Layer01234567(d) e2 decoded from t1, LLaMA 2 13B0 8 16 24 32T arget Layer08162432Source Layer01234567 (e) e2 decoded from t2, LLaMA 2 13B0 8 16 24 32T arget Layer08162432Source Layer05101520 (f) e3 decoded from t2, LLaMA 2 13B0 8 16 24T arget Layer081624Source Layer012345(g) e2 decoded from t1, LLaMA 3 8B0 8 16 24T arget Layer081624Source Layer0246810 (h) e2 decoded from t2, LLaMA 3 8B0 8 16 24T arget Layer081624Source Layer0510152025 (i) e3 decoded from t2, LLaMA 3 8B0 8 16 24 32 40 48 56 64 72T arget Layer081624324048566472Source Layer02468(j) e2 decoded from t1, LLaMA 3 70B0 8 16 24 32 40 48 56 64 72T arget Layer081624324048566472Source Layer02468 (k) e2 decoded from t2, LLaMA 3 70B0 8 16 24 32 40 48 56 64 72T arget Layer081624324048566472Source Layer051015202530 (l) e3 decoded from t2, LLaMA 3 70BFigure 7: Patchscopes success heat-maps for LLaMA models.14126
[[PDF PAGE 15]]0 8 16 24T arget Layer081624Source Layer012345(a) e2 decoded from t1, Pythia 6.9B0 8 16 24T arget Layer081624Source Layer01234567 (b) e2 decoded from t2, Pythia 6.9B0 8 16 24T arget Layer081624Source Layer0246810121416 (c) e3 decoded from t2, Pythia 6.9B0 8 16 24 32T arget Layer08162432Source Layer02468(d) e2 decoded from t1, Pythia 12B0 8 16 24 32T arget Layer08162432Source Layer024681012 (e) e2 decoded from t2, Pythia 12B0 8 16 24 32T arget Layer08162432Source Layer025710121517 (f) e3 decoded from t2, Pythia 12BFigure 8: Patchscopes success heat-maps for Pythia models.14127
[[PDF PAGE 16]]/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057(a) LLaMA 2 7B/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni00000016/uni00000018/uni00000017/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057 (b) LLaMA 2 13B/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057(c) LLaMA 3 8B/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000014/uni00000013/uni00000015/uni00000013/uni00000016/uni00000013/uni00000017/uni00000013/uni00000018/uni00000013/uni00000019/uni00000013/uni0000001a/uni00000013/uni0000001b/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057 (d) LLaMA 3 70B/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057(e) Pythia 6.9B/uni00000014/uni00000056/uni00000057/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni0000002c/uni00000051/uni00000049/uni00000052/uni00000003/uni00000033/uni00000055/uni00000052/uni00000053/uni00000044/uni0000004a/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000015/uni00000051/uni00000047/uni00000003/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000035/uni00000048/uni00000056/uni00000052/uni0000004f/uni00000059/uni00000048/uni00000047/uni00000033/uni00000055/uni00000048/uni00000047/uni0000004c/uni00000046/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000028/uni0000005b/uni00000057/uni00000055/uni00000044/uni00000046/uni00000057/uni00000048/uni00000047/uni00000013/uni00000018/uni00000014/uni00000013/uni00000014/uni00000018/uni00000015/uni00000013/uni00000015/uni00000018/uni00000016/uni00000013/uni00000016/uni00000018/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000037/uni0000005a/uni00000052/uni00000010/uni0000002b/uni00000052/uni00000053/uni00000003/uni00000034/uni00000058/uni00000048/uni00000055/uni0000005c/uni00000003/uni00000024/uni00000051/uni00000056/uni0000005a/uni00000048/uni00000055/uni00000026/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000052/uni00000055/uni00000055/uni00000048/uni00000046/uni00000057 (f) Pythia 12BFigure 9: A comparison of the first layers of each pathway stage between correct and incorrect cases for all models.14128
[[PDF PAGE 17]]0 8 16 24T arget Layer081624Source Layer0246810(a) Source token is t1, LLaMA 2 7B0 8 16 24T arget Layer081624Source Layer0246810 (b) Source token is t2, LLaMA 2 7B0 8 16 24 32T arget Layer08162432Source Layer012345678(c) Source token is t1, LLaMA 2 13B0 8 16 24 32T arget Layer08162432Source Layer01234567 (d) Source token is t2, LLaMA 2 13B0 8 16 24T arget Layer081624Source Layer012345678(e) Source token is t1, LLaMA 3 8B0 8 16 24T arget Layer081624Source Layer024681012 (f) Source token is t2, LLaMA 3 8B0 8 16 24 32 40 48 56 64 72T arget Layer081624324048566472Source Layer024681012(g) Source token is t1, LLaMA 3 70B0 8 16 24 32 40 48 56 64 72T arget Layer081624324048566472Source Layer02468101214 (h) Source token is t2, LLaMA 3 70BFigure 10: Back-patching heat-maps of successful source and target layers for LLaMA models.14129
[[PDF PAGE 18]]0 8 16 24T arget Layer081624Source Layer02571012151720(a) Source token is t1, Pythia 6.9B0 8 16 24T arget Layer081624Source Layer024681012 (b) Source token is t2, Pythia 6.9B0 8 16 24 32T arget Layer08162432Source Layer02468(c) Source token is t1, Pythia 12B0 8 16 24 32T arget Layer08162432Source Layer0246810 (d) Source token is t2, Pythia 12BFigure 11: Back-patching heat-maps of successful source and target layers for Pythia models.14130123version https://git-lfs.github.com/spec/v1oid sha256:67f5c1a93dfe36b13c531725fe377b4b6ff7ea452fb1f324d6af7f01a3d57515size 1917956123version https://git-lfs.github.com/spec/v1oid sha256:4ec628efc8a26a54a7815e84142b6b148a0051d52aa375412d8c248becf97ec0size 997172123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314{ "date": "2026-10-07", "task": "广泛参考正式论文和预印本,选择一个直观、能支持核心观点的下一步比较;探索结束后更新项目skill。", "review_scope": "有选择的原文方法/实验复盘;各项read字段明确本轮阅读范围。不是穷尽性系统综述,也未声称完整阅读所有附录。", "user_principles": [ "重要问题与发现可以与已有工作重合;不为制造差异而避开。", "核心实验与论点应清楚、直观,避免围绕次要细节反复扩展。" ], "recommendation": { "paper_question": "模型准确掌握的事实,何时也能成为组合推理中可继续使用的记忆?", "working_title": "From Factual Recall to Compositional Use in Transformers", "established_scope": "完整共享单块GPT、两跳、模板数据:相同首跳实体监督下,加入输入表示方向约束改善跨事实组合;尚未确认普通独立层及自然预训练LM。", "next_experiment": "普通独立两层完整GPT:首跳实体CE vs 同首跳CE+表示对齐;全文CE参照。配对事实、标签、初值、采样、预算及推理执行。", "primary_endpoint": "只接受过单跳训练的事实形成的未训练两跳查询;并列单跳与训练组合掌握。", "interpretation": "普通模型也改善则拓展范围;只有共享模型改善则保留条件;普通两臂都强则报告已经会组合,不人为制造失败。", "sequence": [ "先普通模型复核强干预", "再新事实写入后的组合使用与保持", "随后事实修改的组合传播及真实事实范围" ], "why_changed_from_previous": "此前A/B迁移先引入训练时序与旧能力保持;普通模型复核直接承接六配对均成立的强结果,并解决论文是否主要依赖Loop的问题。", "contribution": "在重要的记忆与组合使用问题上,连接受控失败、可重复训练补救及适用范围;不以话题避重或新架构名称作贡献。", "training_launched_this_review": false }, "project_evidence": [ { "source": "docs/results.md#representation-alignment", "atomic": "两主臂100%", "intermediate_readout": "两主臂100%", "strict_composition": "12.60% vs 92.32%", "replication": "3全新世界×2初始化", "limit": "共享单块执行两次,joint training,人工模板" }, { "source": "results/shared-cache-branch-v1/report/report.md", "atomic": "100%", "familiar_composition": "48.59% vs 72.17% local/full", "strict_composition": "均接近地板", "limit": "不能把熟悉新链提高当作跨事实迁移" }, { "source": "results/residual-cache-comparison-v1/report/report.md", "result": "没有稳定通用mHC优势;strict均接近地板", "limit": "旧世界配对扩展,不是新世界确认" }, { "source": "results/knowledge-change-v1/report/report.md", "result": "首跳熟悉编辑个别臂均值改善主要由一个世界驱动;第二跳0%", "limit": "当前不支持稳定的更新传播方案" }, { "source": "results/composition-data-curves-v1/report/summary.json", "result": "普通4层低负载高支持可达到强熟悉组合;高负载原子和组合同时下降", "limit": "不能先归因纯组合容量压缩,未形成多宽度尺度定律" }, { "source": "docs/results.md", "result": "原长训练共享4×2在高支持/正则配置strict有强正结果;真实图实体符号化普通模型也有强组合", "limit": "不以短配方的负结果否定Loop或声称对齐普遍必要" } ], "papers": [ { "id": "physics31", "title": "Physics of Language Models: Part 3.1, Knowledge Storage and Extraction", "url": "https://proceedings.mlr.press/v235/allen-zhu24a.html", "status": "ICML 2024", "read": "会议论文§1、训练与数据增强比较;本轮未重新阅读完整预印本附录", "comparison": "同一传记事实库,比较混合训练、先传记后QA以及传记改写/重排;留出人物QA。", "implication": "事实训练与任务使用分开控制,事实在文本中可复现不代表可灵活提取。", "limit": "知识提取任务,不直接建立两跳组合机制;探针方法不作为本项目的新预测任务。" }, { "id": "physics32", "title": "Physics of Language Models: Part 3.2, Knowledge Manipulation", "url": "https://proceedings.iclr.cc/paper_files/paper/2025/file/d5494c8747276d3cdb2598e5617de89d-Paper-Conference.pdf", "status": "ICLR 2025", "read": "会议extended abstract §1.1及任务/训练比较;并非完整长版附录", "comparison": "所有人物事实受训,仅部分人物有操作QA;比较直接输出与显式CoT。", "implication": "用掌握的事实是否能用于新操作,是清楚且重要的��问题。", "limit": "CoT同时改变信息呈现和计算;不能把补救仅归因于表示或计算中的一个。" }, { "id": "physics33", "title": "Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws", "url": "https://proceedings.iclr.cc/paper_files/paper/2025/file/26d3c9a66836ded8f34a944f2bfe868e-Paper-Conference.pdf", "status": "ICLR 2025", "read": "主文信息计量、曝光定义、容量与优化比较", "comparison": "随机传记事实的可计量信息量,改变参数量和事实曝光;用知识token损失估计存储。", "implication": "区分事实独立信息量、训练计算和知识掌握;派生组合答案不另计独立bits。", "limit": "存储容量规律不直接成为组合容量规律;当前单宽度、原子也下降的曲线不足以声称后者。" }, { "id": "factual2025", "title": "Understanding Factual Recall in Transformers via Associative Memories", "url": "https://proceedings.iclr.cc/paper_files/paper/2025/file/0bf9f909c24c8879d1b7f86fa50a9e49-Paper-Conference.pdf", "status": "ICLR 2025", "read": "§2–3的构造、假设及事实提取建模", "comparison": "随机键值嵌入下,线性/MLP关联记忆的存储与Transformer事实提取。", "implication": "关联记忆为限定模型提供解释视角,研究事实怎样被检索和继续使用。", "limit": "随机嵌入、单跳及不同矩阵条件不可直接套成训练后GPT普遍容量或串扰定律。" }, { "id": "hebbian2026", "title": "MLPs are Hebbians: Constructing Efficient Fact-Storing MLPs for Transformers", "url": "https://arxiv.org/abs/2607.10034", "status": "预印本;作者仓库称COLM 2026接收,未独立核对会议页", "read": "§3.1–3.2、§5、讨论与模块替换方法;未读完82页全部证明", "comparison": "干净键查询可存储但注意力噪声下不可用;冻结读者并替换事实MLP。", "implication": "单独正确与在后继计算中可用可分离;模块替换提供构造性证据。", "limit": "单层构造、冻结事实MLP不等于自然GPT模块分离;文中将多跳留作扩展。" }, { "id": "press2023", "title": "Measuring and Narrowing the Compositionality Gap in Language Models", "url": "https://aclanthology.org/2023.findings-emnlp.378/", "status": "Findings EMNLP 2023", "read": "本轮核对官方摘要、主问题和发表状态;未重新阅读全文", "comparison": "各子问题可答而整体失败;直接输出、CoT和Self-Ask。", "implication": "论文开篇用两条事实与一个组合问题,读者能直接理解差距。", "limit": "外部搜索改变可访问信息;拆题调用成功不直接证明内部连续检索。" }, { "id": "ramesh2024", "title": "Compositional Capabilities of Autoregressive Transformers: A Study on Synthetic, Interpretable Tasks", "url": "https://proceedings.mlr.press/v235/ramesh24a.html", "status": "ICML 2024", "read": "§1、§3任务、位置与任务训练划分;关键逐步/直接输出比较", "comparison": "固定原子函数,训练部分函数组合;改变组合顺序支持和是否生成中间步骤。", "implication": "明确说清留出的是组合、事实还是操作角色;一个主比较比增加架构名称更有解释力。", "limit": "函数组合任务与具体事实新写入不同;生成中间步骤同时改变执行过程。" }, { "id": "grokking2024", "title": "Grokking of Implicit Reasoning in Transformers: A Mechanistic Journey to the Edge of Generalization", "url": "https://proceedings.neurips.cc/paper_files/paper/2024/file/ad217e0c7fecc71bdf48660ad6714b07-Paper-Conference.pdf", "status": "NeurIPS 2024", "read": "§2–3方法、训练划分与附录E.2共享层比较", "comparison": "所有原子事实受训,只有ID事实进入组合训练;长训练及普通/共享层比较。", "implication": "拟合原子、熟悉事实新组合、跨事实组合是不同学习结果;长期共享计算正结果必须保留。", "limit": "架构效果依赖训练支持、正则与时长;不能由短训练失败推出结构无法组合。" }, { "id": "implicit2025", "title": "How do Transformers Learn Implicit Reasoning?", "url": "https://proceedings.neurips.cc/paper_files/paper/2025/hash/5f1cb1d23261b19cbd45f90f7b4f251f-Abstract-Conference.html", "status": "NeurIPS 2025", "read": "§2.1–2.4数据/角色对照、§3.1中间状态干预", "comparison": "ID/OOD事实共享实体关系词表;限制事实出现在首跳或第二跳的经历。", "implication": "事实的使用经历影响组合迁移,是可以继续深化的重要发现。", "limit": "其第二跳暴露结果对应具体配方;不能写成所有Transformer的必要条件。" }, { "id": "yao2025", "title": "Language models can learn implicit multi-hop reasoning, but only if they have lots of training data", "url": "https://aclanthology.org/2025.emnlp-main.490/", "status": "EMNLP 2025", "read": "§3–4数据/预算、§4.3关系组合对照、附录E训练细节", "comparison": "固定层级事实图,改变独立k-hop问题覆盖;所有人物事实训练,留出QA。", "implication": "数据中独立组合支持和重复曝光要分开;用易懂的支持曲线说明训练如何教会使用。", "limit": "固定训练步下独立样本数也改变每例曝光;k变化不是纯执行步变化。" }, { "id": "scaling-composition2025", "title": "Scaling can lead to compositional generalization", "url": "https://proceedings.neurips.cc/paper_files/paper/2025/hash/5047b64366bc0dbf5047de85f1e0c7be-Abstract-Conference.html", "status": "NeurIPS 2025", "read": "§2、§3.1、§3.3–3.4及其支持定义", "comparison": "Hyperteacher组合任务,改变任务覆盖、模型大小与编码;留出任务。", "implication": "学习规模规律必须标注训练覆盖条件;不能把负结果先称架构容量上限。", "limit": "模块任务和事实图不同;线性可解码相关性不构成唯一机制,也不需照搬预测探针。" }, { "id": "latent-multihop2024", "title": "Do Large Language Models Latently Perform Multi-Hop Reasoning?", "url": "https://aclanthology.org/2024.acl-long.550/", "status": "ACL 2024", "read": "问题定义、两跳实体/关系实例、首跳与第二跳的分别检验", "comparison": "首跳召回与对首跳实体属性的后续使用分别测量和干预。", "implication": "中间实体被表示与真正影响下一步使用要区分。", "limit": "自然模型证据依关系类型变化;不能用可解码结果单独替代使用证据。" }, { "id": "hopping-late2024", "title": "Hopping Too Late: Exploring the Limitations of Large Language Models on Multi-Hop Queries", "url": "https://aclanthology.org/2024.emnlp-main.781/", "status": "EMNLP 2024", "read": "§1、§2的成功/失败筛选、§3与back-patching主比较", "comparison": "单跳均正确、两跳失败的案例中,将晚层状态回传早层检验补救。", "implication": "后继检索能否访问所需计算,提供知识可继续使用的另一种解释。", "limit": "筛选后、搜索修复点的结果不等于全池泛化或普遍机制;不需下一步另做大patch矩阵。" }, { "id": "socrates2025", "title": "Do Large Language Models Perform Latent Multi-Hop Reasoning without Exploiting Shortcuts?", "url": "https://aclanthology.org/2025.findings-acl.205/", "status": "Findings ACL 2025", "read": "§1–2快捷答案与关系/实体类型控制、关键自然模型比较", "comparison": "排除头尾实体潜在共现和频率捷径,再比较潜在组合与CoT;按桥实体类型报告。", "implication": "自然事实验证要避免整体正确率掩盖熟悉模式或实体类型差别。", "limit": "未能直接核查全部模型预训练数据;以受控新世界为机制主证据,自然数据检验范围。" }, { "id": "mquake2023", "title": "MQuAKE: Assessing Knowledge Editing in Language Models via Multi-Hop Questions", "url": "https://aclanthology.org/2023.emnlp-main.971/", "status": "EMNLP 2023", "read": "事实链构造、反事实编辑、§3.4指标、§4方法对比", "comparison": "编辑单条事实后比较单跳编辑成功与依赖链答案变化。", "implication": "知识更新后的组合使用是重要后续,不能仅用直接写入准确率判定成功。", "limit": "MeLLo外部记忆和多轮调用改变信息/计算;原指标多个问法任一成功与本项目完整生成指标不同。" }, { "id": "ripple2024", "title": "Evaluating the Ripple Effects of Knowledge Editing in Language Models", "url": "https://aclanthology.org/2024.tacl-1.16/", "status": "TACL 2024", "read": "§1–3任务与逻辑后果/知识保持范围、主要评价结构", "comparison": "单条编辑与其逻辑后果、相关事实和无关知识保持分别评价。", "implication": "将直接写入、组合传播、无关保持做清楚的结果比较,延伸事实记忆到使用。", "limit": "多类逻辑关系不是统一两跳检索;成功的上下文编辑不代表参数编辑传播。" }, { "id": "coconut2025", "title": "Training Large Language Models to Reason in a Continuous Latent Space", "url": "https://arxiv.org/abs/2412.06769", "status": "COLM 2025;已发现官方会议PDF,下载使用arXiv版本", "read": "§3训��/推理、§4.1任务与基线、主要直接/连续/文本步骤比较", "comparison": "用最后隐藏状态作下一步输入;逐步将CoT转为连续状态。", "implication": "“提取结果怎样变成下一步输入”有直接可读的任务表达。", "limit": "大量CoT监督、上下文图推理,与只含参数事实的联合训练不同;本项目不借此声称相同机制。" }, { "id": "loop2025", "title": "Reasoning with Latent Thoughts: On the Power of Looped Transformers", "url": "https://proceedings.iclr.cc/paper_files/paper/2025/file/2676109d49d1eb26d6bc584a8f556305-Paper-Conference.pdf", "status": "ICLR 2025", "read": "既有本地原文与本轮相关条件复核;表达能力与计算深度关系", "comparison": "共享参数、改变执行深度,构造多步计算能力。", "implication": "Loop可以区分参数量与执行计算,是机制比较工具。", "limit": "表达能力构造不等于SGD会学会正确算法;不推出任何任务单调增加R就会受益。" }, { "id": "xu2025", "title": "On Expressive Power of Looped Transformers: Theoretical Analysis and Enhancement via Timestep Encoding", "url": "https://proceedings.mlr.press/v267/xu25x.html", "status": "ICML 2025", "read": "本轮官方摘要与发表状态;未重读完整证明", "comparison": "固定共享结构的逼近能力及timestep编码增强。", "implication": "理论结论标注具体架构和条件;普通GPT不用该定理作性能保证。", "limit": "不据摘要另设新timestep架构批次或声称一般循环深度下限。" }, { "id": "ouro2026", "title": "Scaling Latent Reasoning via Looped Language Models", "url": "https://arxiv.org/abs/2510.25741", "status": "预印本,2025初版、2026-07修订;本轮未核实正式会议", "read": "§3–4架构/训练、§6.1–6.2存储与知识操作及QA划分", "comparison": "参数量相同的bioS存储;Mano和全部事实已参与训练的留出多跳QA;iso-param/iso-flop分列。", "implication": "直接借鉴“记多少”与“会怎样用”的分开比较,Loop为重要条件。", "limit": "留出QA不等于留出事实的组合经历;大模型训练/数据差异不作为单一机制归因。" }, { "id": "mobius2026", "title": "Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning", "url": "https://arxiv.org/abs/2608.14290", "status": "2026预印本", "read": "§2架构、§3从零/持续训练比较与作者机制边界", "comparison": "共享FFN知识库供多个attention查询;从零训练的数据效率及改架构后持续训练、SFT/RL表现。", "implication": "知识与计算分离值得继续研究;直观架构图不等于已证实语义模块分离。", "limit": "多项架构与训练改变同时发生;作者将压缩/短CoT机制仍列作假说。" }, { "id": "composition-collapse2026", "title": "Composition Collapse: Stable Factual Knowledge Does Not Imply Compositional Reasoning", "url": "https://arxiv.org/abs/2605.26789", "status": "2026预印本", "read": "§3两门槛、§4样本数/任务、§5同底座干预与生成格式边界", "comparison": "稳定原子知识和孤立子题正确后比较整体任务,补同底座训练干预。", "implication": "把相同事实掌握下的组合差别呈现清楚;重要发现重合可以深化。", "limit": "部分单元通过案例很少、任务深度定义和生成格式影响较大;无需引入复杂门槛体系作为本项目中心。" }, { "id": "loop-horizon2026", "title": "Beyond the Training Horizon: Mechanisms and Limits of Length Generalization in Looped Transformers", "url": "https://arxiv.org/abs/2609.33144", "status": "2026预印本;PDF标注under review", "read": "§3、§4的状态/计算地位比较、附录A完整训练配置差异", "comparison": "KG/函数组合/多项式迭代的长链泛化;相同语义内容在不同计算状态下是否继续被用。", "implication": "可表示的内容和可继续执行的状态不同;允许研究相同重要主题。", "limit": "两模型还改变输入注入、归一化、遮罩和读出;长链泛化不等于新事实迁移。" }, { "id": "reversal2024", "title": "The Reversal Curse: LLMs trained on A is B fail to learn B is A", "url": "https://proceedings.iclr.cc/paper_files/paper/2024/hash/5178b2f2d7c44aa390c0777dc77b3f0c-Abstract-Conference.html", "status": "ICLR 2024", "read": "§1与§2.1虚构事实、辅助双向事实和同向/逆向评价", "comparison": "虚构事实按名称→描述或描述→名称训练,分别测训练方向与相反方向。", "implication": "借鉴一个任务例子、一个清楚的关键对照表达重要学习限制。", "limit": "逆向检索与两跳组合不同;自然名人案例不替代受控训练证据。" }, { "id": "gatmiry2024", "title": "Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning?", "url": "https://proceedings.mlr.press/v235/gatmiry24b.html", "status": "ICML 2024", "read": "本轮核对官方摘要/发表状态;完整GPT原实验已记录§3–5及附录A方法借鉴", "comparison": "受限线性looped attention的总体损失最优解与多步预条件梯度下降。", "implication": "复用已验证完整GPT干预;这里只借鉴状态格式支持后继计算的思路。", "limit": "本轮不把线性回归、矩阵保持或梯度流定理用于完整非线性GPT。" } ]}123version https://git-lfs.github.com/spec/v1oid sha256:69f389ed241fc7c81393463939c8f337d949f2d796d6497742968bcff2377282size 2539382123version https://git-lfs.github.com/spec/v1oid sha256:20612ef91b39053d26722becc999bb87824c534720ad8945409dbaf3bf3ceb83size 2186101123version https://git-lfs.github.com/spec/v1oid sha256:4e16cd698dee6ab17617356b7cdf1ba1fc391ecc3568aacd16d157484fb9c239size 170258212345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082[[PDF PAGE 1]]2026-8-17Intern-S2-Mobius: Foundation Model withDecoupled Knowledge and ReasoningIntern-S2-Mobius Team, Shanghai AI LaboratoryWe introduceMobius-v0, an architecture that comprises a globally shared Memory (FFN) that stores knowledgevectors and multiple Reasoners (Self-Attn) that iteratively achieve compositional reasoning. Using hidden statesas cache and carrier, reasoners repeatedly query memory for required knowledge-vectors, while the knowledgeis transmitted back to reasoning operators. Through this knowledge-reasoning-separation architecture, Mobiusachieves better knowledge compression and reasoning efficiency. Built upon Mobius-v0 architecture: 1) Our 7Bmodel trained-from-scratch achieves similar downstream score as a 7B Transformer baseline with 62.6% ofbaseline’s training data. 2) OurIntern-S2-Mobius, continually-pretrained from Qwen3.5-35B, achieves similardownstream score while delivering nearly 4×end-to-end inference speedup.1. The development bottleneck of the Foundation ModelsSelf-AttnFeedForwardAdd&NormalizeSelf-AttnFeedForwardAdd&NormalizeAdd&NormalizeAdd&NormalizeSelf-AttnGlobal-SharedVectorDatabaseAdd&NormalizeAdd&Normalizememoryreasonercache(a)Transformer (b)MobiusFigure1: The Comparison between Transformer and Mobius.The Transformer [69] stands as the most prevalent and powerful architectural paradigm to date, permeatingvirtually every domain—from language and vision, to video and scientific computing [4, 15, 16, 81]. Along itsevolutionary trajectory, two pivotal research directions have emerged. The first preserves the model architectureintact while increasing expenditure elsewhere to enhance capability: scaling model parameters, expandingtraining corpora, and elongating reasoning chains typically endow models with richer knowledge and thecapacity to tackle more intricate problems [33, 37, 45, 71]. The second reduces training and inferenceoverhead by lowering architectural complexity to improve practicality: motivated by the widely held view*Model is available athttps://huggingface.co/internlm/Intern-S2-MobiusarXiv:2608.14290v1 [cs.AI] 14 Aug 2026
[[PDF PAGE 2]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoningthat the quadratic complexity of self-attention constitutes a bottleneck for ultra-long contexts, linear attentionmechanisms such as SSM and GDN have been proposed [10, 25, 38, 78], and their variants have since beenintegrated into mainstream contemporary architectures.102 103Tokens (B)0.300.350.400.450.50MMLU Accuracy0.626 × 1031.6x fasterMobiusTransformerFigure2: The MMLU score of Mobius and Transformer pre-trained from scratch.Yet both approaches are now hitting their limits.On one hand, scaling data and parameters has yieldedincreasingly powerful models at high returns on investment, yet the Scaling Law has gradually plateaued and isapproaching diminishing marginal returns [33,37]. Long chains of thought have served us well in domains suchas mathematics, code, and physics, yet models tend to produce verbose, tangential output regardless of problemdifficulty—a trait typically regarded in human society as a sign of insufficient intelligence [49, 54]. On the otherhand, reducing the computational complexity of full attention does bring certain efficiency gains, yet it hasbecome increasingly apparent that the efficiency improvements achieved at the cost of sacrificing a substantialportion of model capability have not made models truly affordable enough for commercial deployment [3].Confronted with this bottleneck in AI development, we pursue an alternative path:increasing architecturalcomplexity to raise the ceiling of model intelligence, thereby reducing the end-to-end overhead.Tothis purpose, we propose theMobius, which decouples the binding between knowledge vectors (FFN) andreasoning operators (Self-Attn), thereby constructing a shared knowledge vector database accessible to allreasoning operators. Although the large scale of this shared vector database renders each inference activationhighly sparse, introducing greater memory access pressure and lower per-pass forward efficiency, we find thatthis implementation achieves nearly 4× end-to-end inference speedup over the Transformer architecture withsame parameters while maintaining equivalent reasoning accuracy.The efficiency gains of Mobius reasoning stem primarily from two sources: a more flexible activation pathduringinference, andamoredynamiclatent-spaceiteration, whichtogetherendowMobiuswithamoreefficientand concise output pattern. The first advantage arises because, unlike the combination of hierarchical storageand forward residual connections in Transformer, Mobius’s shared storage natively introducesBackwardResidual Connection. This mechanism means that not only can shallow hidden states access deep-layerknowledge, but deep hidden states can also access shallow-layer knowledge, which enhances the compositionalgeneralization across different layers and thereby accelerates the synthesis of critical information. The secondadvantage arises because Mobius natively introducesDynamic Latent Reasoning: whereas Transformer usestokens as the medium of information transfer and requires traversing all layers to complete the inference of asingle token, Mobius can iterate and refine latents against the full knowledge repository within just a few layers,rather than requiring multiple full-layer iterations as in traditional latent reasoning. These latents are not tightlyboundtoanyspecifictoken, andonlyatdeeperlayersaremultipletokensdecodedsynchronously. Thisapproachboth increases the density of information transfer and dynamically allocates varying computational costs todifferent tokens. Ultimately, Mobius completes the same reasoning task with markedly fewer high-quality2
[[PDF PAGE 3]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoningtokens, achieving substantially higher end-to-end inference efficiency than Transformer.Table1: Performance comparison across general and scientific benchmarks. The higher score in each row ishighlighted inbold.General TasksBenchmark Intern-S2-Mobius-35B Qwen3.5-35BMMLU Pro 89.0585.31GPQA Diamond 80.8180.24IMO Bench 81.2577.50AIME 2026 95.3192.08HMMT 2026 85.5178.50UGD hard 73.0278.02AMO 58.0050.00SimpleQA 28.9021.39HLE 19.1122.40AVG Score 67.8865.05Scientific TasksBenchmark Intern-S2-Mobius-35B Qwen3.5-35BBiology-Instructions 51.403.77Mol-Instructions 45.7321.70MolecularIQ 59.2929.13AVG Score 52.1418.202. What inspired the design of Mobius?In Transformer-based architectures, the Feed-Forward Network is conventionally regarded as responsible forknowledge storage [20, 52], Hidden States for information transmission, and Self-Attention for compositionalreasoning [17, 69].Concurrently, owing to the hierarchical structure of Transformer, Self-Attention at each layer primarilyprocesses knowledge inputs received from the preceding layer and induces the FFN at the current layer toproduce outputs required by the next layer. Although residual connections establish more flexible connectionsacross layers [31, 34, 67], only shallow Hidden States can access deep-layer knowledge, while deep-layerSelf-Attention can only process knowledge originating from shallow layers; the model remains incapable ofinformation transfer in the opposite direction.To construct information transfer in the reverse direction, current models predominantly rely on Chains ofThought [26, 71]. After each forward pass, the model generates a new token that serves to activate knowledgein the next inference step. Through iterative token generation, the model continuously extracts valuableknowledge from the FFN until this knowledge suffices to produce critical tokens or even the final answer.The joint construction of artificial intelligence models using exclusively hierarchical structures, forwardresidual connections, and token-mediated chains of thought is inefficient. To equip models with sufficientknowledge for answering complex questions, an inordinate amount of computation is expended on producinglengthy, redundant reasoning chains. To mitigate this issue, we have redesigned the model architecture andpropose Mobius.2.1. Mobius’ first innate talent —— Backward Residual ConnectionResidual connections have become one of the most critical components in modern deep learning models [31].Seemingly minor, they bear the crucial responsibility of transmitting inter-layer information during forwardpropagation and stabilizing gradient magnitudes during backpropagation. [32, 75] Although numerous variantsof residual connections have since emerged, such as Hyper-Connection and Attention-Residual [39, 74, 80],all mainstream residual to date retain their unidirectional nature. For instance, during forward propagation,3
[[PDF PAGE 4]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning24 25 26 27 280.501.001.502.002.504.6x faster2.9x faster24 25 26 27 282.004.006.008.00MMLU Pro24 25 26 27 280.501.001.502.002.503.003.50GPQA Diamond24 25 26 27 280.100.120.140.160.180.200.220.24IMO Bench24 25 26 27 280.150.200.250.300.350.400.450.50AIME 202624 25 26 27 280.100.120.140.160.180.200.220.24HMMT 2026Request Throughput (req/s)Batch SizeAverageMobius TransformerFigure3: The inference efficiency of Mobius continual pre-trained from Qwen3.5.residual only convey shallow-layer information to deeper layers. [34] This unidirectionality entails significantdrawbacks: if certain critical knowledge fails to be activated during shallow-layer computation, the model maystruggle to decode valuable tokens in that reasoning round, and can only resort to generating low-informationtokens via chains of thought to proceed to the next reasoning step.To mitigate this phenomenon, rendering residual connections bidirectional is necessary—that is, enablingdeep layers to access shallow-layer knowledge during forward propagation. However, a direct implementation ofsuch backward residual connections is infrastructure-unfriendly, as it may introduce more complex computationgraphs and harder-to-parallelize asynchrony. To this end, we opt for an indirect realization of backwardresidual connections: different layers share a single, oversized knowledge repository, granting every layerthe opportunity to access all knowledge within the model. Empirical results ultimately corroborate that thisform of backward residual connection contributes meaningfully to improving the model’s end-to-end inferenceefficiency.2.2. Mobius’ second innate talent —— Dynamic Latent ReasoningLong chains of thought (Long CoT) have become an indispensable component in large language modelreasoning [26, 45, 71]. Empowered by this technique, contemporary large language models can now solve awide spectrum of complex reasoning problems, spanning mathematics, physics, and code generation. Yet thecost of Long CoT is exorbitant. On one hand, longer reasoning chains entail the generation of more tokens,with generation cost growing non-linearly with chain length. On the other hand, current models frequentlyadopt a trial-and-error-and-correct approach when tackling complex problems, resulting in substantial tokenredundancy during extended reasoning. Moreover, such models tend to produce excessively verbose responseseven for simple problems. This verbosity stems partly from the residual connections discussed above, and partlyfrom the fact that the minimal unit of our current reasoning is the token—a discrete, low-information-densitystorage [9].Mobius internalizes processes such as deliberation, trial-and-error, and refinement into the optimization of acontinuous vector, and enables the model to dynamically allocate computational budget to different tokens. Thiscreates the opportunity for the model to produce fewer superfluous tokens while achieving more efficient andmore intelligent reasoning. Mobius can be regarded as an upgraded synthesis of the Looped Transformer and4
[[PDF PAGE 5]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning050001000015000200001.5xshorter0100020003000400050004.6xshorterMMLU Pro020004000600080001000012000140005.0xshorterGPQA Diamond050001000015000200002500030000350001.4xshorterIMO Bench05000100001500020000250001.5xshorterAIME 20260500010000150002000025000300001.2xshorterHMMT 2026Avg Output Length (tokens)AverageMobius TransformerFigure4: The average output length of Mobius continual pre-trained from Qwen3.5.the Diffusion Language Model [21, 43, 55], employing more efficient latent reasoning and parallel prediction.First, Mobius operates at a higher loop frequency, completing one representation iteration with extremelyfew layers. Second, during inference, Mobius acquires joint representations of multiple tokens simultaneouslythrough more compact, high-information-density continuous vectors. This, on one hand, alleviates the pressurefrom parallelizing multiple hidden states, reduces the complexity of KV-cache management during the loopingprocess, and enhances the continuous differentiability of the vector iteration process. Meanwhile, this nativelatent reasoning endows the model with a more dynamic and unfettered iteration process, without constrainingthe model to decode a fixed number of tokens at specific iteration steps.2.3. One Stone Two Birds —— Disentangling Knowledge Vectors and Reasoning OperatorsOverall, Mobius achieves these two innate talents by decoupling the knowledge storage module, the FFN,from its layer-wise binding, and constructing a globally shared knowledge-vector database. First, this grantsall reasoning operators, the Self-Attention, read access to the entire body of knowledge. Further, the Self-Attention gains the opportunity to access all knowledge within significantly fewer layers, and performs adaptivemulti-round iteration through recurrent latent reasoning via Hidden States, ultimately emitting refined, high-information-density tokens in a single burst.In constructing the shared knowledge repository, we opted for a straightforward horizontal concatenation,as the FFN is conventionally regarded as a Key-Value Knowledge-Vector Pool, and this concatenation approachpreservesthecorrespondencerelationshipsamongtheseknowledgevectors. Althoughsuchsimpleconcatenationyields performance benefits, excessive parameter activation degrades the model’s training and inferenceefficiency. Therefore, at larger parameter scales, we employ a block-wise partitioning technique analogous toMoE [63] to partition the FFN, with sparse activation during forward propagation.3. How about Mobius’ performance?To validate the performance of Mobius, we conducted both training-from-scratch (TFS) and continual pre-training (CPT) experiments. For the TFS experiments, we trained 7B-A1B MoE models — one with Mobiusand one with Transformer — on 1TB tokens, and compared their MMLU scores. For the CPT experiments, we5
[[PDF PAGE 6]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningTable2: Step-aligned comparison between Intern-S2-Mobius-35B and Qwen3.5-35B on a linear-algebramultiple-choice question. Both models select the correct answer (Option C). Token counts are computed usingthe Qwen3.5-35B tokenizer. Mobius completes the same reasoning steps with fewer tokens, which mainlybenefits from the model’s elimination of repeated derivation and checks.Reasoning Trace ComparisonAligned Step Intern-S2-Mobius-35B Qwen3.5-35BTask framing17 tokens.“The user wants me to evaluate thetruth value of two statementsregarding linear algebra.”20 tokens.“The user wants me to evaluate twostatements and determine their truthvalues from a list of options.”Statement 1178 tokens.“Counter-example: Let 𝑣1 = (1,0) and𝑣2 = (2,0). Then2𝑣 1−𝑣 2 = 0, sothey are linearly dependent. ...Statement 1 is False.”283 tokens.“Consider the zero vector. Let𝑣1 = (1,0)and𝑣 2 = (0,0). ...Consider two parallel vectors. Let𝑣1 = (1,0)and𝑣 2 = (2,0). ...Statement 1 isFalse.”Statement 2142 tokens.“A basis is a linearly independentspanning set. Since{𝑣1, . . . , 𝑣𝑘} spans𝑉and is linearly independent, itforms a basis for𝑉. ...dim(𝑉) =𝑘.”197 tokens.“The set forms a basis for𝑉if it spans𝑉and is linearly independent. ...Therefore,{𝑣 1, . . . , 𝑣𝑘}is a basis for𝑉. ...dim(𝑉) =𝑘.”Option matching22 tokens.“Statement 1 is False, Statement 2 isTrue. This matches Option C.”122 tokens.“The combination is False, True. Thiscorresponds to Option C.”Repeated derivation and checks —1,147 tokens.“Step-by-step derivation:...Counterexample: Let𝑣 1 = (1,0)and𝑣2 = (2,0). ...Final check:... If𝑘= 0? ... Works. ... Option C.”Visible final answer157 tokens.“The vectors(1,0)and(2,0)arelinearly dependent because one is ascalar multiple of the other. ... This isthe definition of a basis. ...ANSWER: C”595 tokens.“Step 1: Evaluate Statement 1...2𝑣1−1𝑣 2 = (0,0). ... Statement 1 isFalse.Step 2: Evaluate Statement 2...dim(𝑉)is equal to𝑘. ...ANSWER: C”Total 516 tokens 2,364 tokensused Qwen3.5-35B-A3B as the starting checkpoint, continued pre-training on 1TB tokens, and subsequentlyperformed supervised fine-tuning (SFT) and reinforcement learning (RL).3.1. Mobius delivers markedly better data efficiency than Transformer.As shown in Figure 2, Mobius achieves significantly higher MMLU scores than Transformer across all stages oftraining. Moreover, when using Transformer’s score at 1TB tokens as the baseline, Mobius attains the samescore with only 0.626×data — that is, Mobius exhibits 1.6×data efficiency of Transformer.The mechanism by which Mobius achieves higher data efficiency remains to be fully explored. Nevertheless,we hypothesize that under the Transformer architecture, parameters across layers exhibit considerable redun-dancy—for instance, the same piece of knowledge may be redundantly stored in multiple layers. Upon switchingto the knowledge-reasoning-decoupled Mobius architecture, the model can attain superior compression rates,thereby enabling it to acquire sufficient knowledge with substantially less training data.6
[[PDF PAGE 7]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning3.2. Mobius matches Transformer-level reasoning with far greater inference efficiency.Given the prohibitive cost of pre-training from scratch, to validate Mobius’s capabilities at scale, we chose tocontinue training from an existing open-source base model. As shown in Table 1, starting from Qwen3.5 andswitching to the Mobius architecture for continued pre-training not only preserves but actually enhances themodel’s overall capabilities.More notably, switching to Mobius not only preserves fundamental reasoning capabilities but also improvesend-to-end inference efficiency. As shown in Figure 3, aggregated across multiple evaluation benchmarks,Mobius achieves substantially higher request throughput than Transformer. We also examined the inferencelength of both models, visualized in Figure 4, which reveals that the improvement in Mobius’s end-to-endinference efficiency primarily stems from shorter CoT lengths. When presented with identical problems,Mobius resolves them with markedly shorter reasoning chains, whereas Transformer requires longer CoT fordeliberation.Although the precise mechanism behind Mobius’s shorter CoT reasoning remains not fully established, wehypothesize that this may be attributed to Mobius’s native latent reasoning characteristic, which internalizes thedeliberation process within the model and achieves more efficient reasoning through continuously differentiableoptimization.However, whether Mobius merely hacks the problem or genuinely provides a more efficient mode ofreasoning remains to be determined. By comparing multiple cases, we find that the shortened CoT in Mobiusstems from the latter. The case in Table 2 is from MMLU-Pro Mathematics and tests two basic linear-algebrastatements. The first statement is false because two vectors inR2 need not be linearly independent. Thesecond statement is true because a linearly independent set that spans𝑉 is a basis of𝑉, so its𝑘 vectors implydim(𝑉) =𝑘. The correct answer is therefore Option C: False, True.4. Mobius’ relationship with mainstream researchRecurrent propagation Global mappingTokendimensionKnowledgedimensionRNNx1 x2 x3 x4h1 h2 h3 h4Transformerx1 x2 x3 x4h1 h2 h3 h4same design principle,different dimensionTransformerL3L2L1Self-Attn FFNSelf-Attn FFNSelf-Attn FFNMobiusL3L2L1ReasonerReasonerReasonerSharedKnowledgeMemoryK1K2...Knglobal address space, sparse activationFigure5: The comparison between RNN, Transformer, and Mobius.4.1. Latent ReasoningChain-of-thought (CoT) externalizes reasoning into intermediate tokens [71], but incurs sequential decodingoverhead. Latent reasoning instead performs computation in continuous states, exploring three directions:7
[[PDF PAGE 8]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoningcontinuous thought, looped computation, and parallel refinement.4.1.1. Continuous ThoughtContinuous-thought approaches replace discrete reasoning tokens with differentiable representations passedbetween reasoning steps. COCONUT directly feeds the final hidden state back as the next input embedding,allowing intermediate computation to proceed without decoding each state into language [30]. CODI com-presses explicit CoT supervision into continuous states through self-distillation [64], while SoftCoT generatesinstance-specific soft thoughts with a lightweight assistant and projects them into the representation spaceof a target language model [76]. These approaches demonstrate that continuous states can preserve usefulreasoning information while shortening or eliminating explicit rationales.These approaches expose a small set of latent states that subsequent tokens can attend to and reuse asshared context. Mobius further makes this pattern a native architectural capability: its recurrent states arerefined against the shared Memory and jointly support multiple future tokens, yielding higher-density reasoningwithout verbose traces.4.1.2. Looped Language ModelsLooped language models increase effective depth by repeatedly applying shared computation blocks. UniversalTransformers introduced recurrent refinement across depth with parameter sharing [12], while subsequentanalyses established the computational expressivity of Looped Transformers [21]. More recent work connectseffective depth directly to reasoning: looped models can emulate multi-step latent computation and approachmuch deeper non-looped models on reasoning tasks [60], while recurrent-depth pre-training enables test-time compute scaling by increasing the number of latent iterations without generating additional reasoningtokens [19].Mobius also scales computation through latent recurrence, but performs each update over only a fewlayers while retaining access to the full shared Memory. This higher update frequency enables more iterativerefinement and concentrates reasoning into higher-information-density latent states.4.1.3. Additional Latent Computation StepsAnother line of work increases reasoning capacity by introducing extra latent computation steps before genera-tion. Pause-token methods add learned placeholders to defer prediction and create additional computationspace [24]. Hidden Decoding expands each token into multiple latent streams within a single forward pass,using intermediate key–value states as reusable computation traces [46]. Diffusion language models achievesimilar effects through iterative refinement of continuous or masked representations [43, 55]. These methodsshift computation from explicit CoT traces to latent trajectories.Mobius extends this idea through recurrent latent refinement without explicit placeholders or diffusionsteps. Its Reasoners repeatedly retrieve from a shared knowledge-vector Memory, refine high-density latentstates, and decode multiple tokens in parallel.4.2. Efficient ReasoningHistorically, the predominant paradigm for language model inference relied on autoregressive single-tokengenerationfromasinglestrongmodel, augmentedwithlongchainsofthought. Toimproveend-to-endinferenceefficiency, two approaches have gained increasing traction: Speculative Decoding, which enhances inferenceparallelism, and Concise CoT, which reduces the sequential length of reasoning chains.4.2.1. Speculative DecodingSpeculative decoding accelerates autoregressive generation by using a cheap drafter to propose a block, or atree, of future tokens and verifying these candidates in parallel with the target model [8, 42, 53, 68]. Withrejection-sampling correction, this verification preserves the target model’s output distribution. While classicalmethods employ a lightweight external draft model, later work develops internal drafters based on auxiliarydecoding heads or predicted hidden features [2, 7, 44]. MTP is such an internal drafting mechanism rather8
[[PDF PAGE 9]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoningthan a decoding protocol itself: auxiliary heads sharing the target backbone predict multiple future tokens[22, 47, 51].Whether employing a draft model or other strategies, Speculative Decoding traverses all knowledge onlyonce before token prediction. In contrast, Mobius performs multiple rounds of knowledge traversal and multi-token iteration internally, yielding hidden states of higher information density prior to final decoding, withnative support for multi-token prediction.4.2.2. Concise Chain of ThoughtLong chain-of-thought (CoT) reasoning can improve performance on challenging tasks, but its autoregressivegeneration incurs substantial inference cost and latency. Recent work therefore seeks concise CoT throughseveral complementary approaches: supervised methods learn from pruned or paired long–short trajectories,or internalize explicit rationales into implicit or dense representations [9, 13, 14, 36, 73, 79]; RL-basedmethods shape reasoning length through reward design, including controllable compression and length-awareobjectives [11, 18, 50, 65]. Although RL can elicit advanced behaviors such as self-correction, verification, andbacktracking [26, 62], outcome-only rewards often favor longer trajectories because additional tokens enablefurther exploration and error correction [77]. The central challenge is thus to reduce CoT verbosity withoutremoving the deliberation needed for accurate and robust reasoning.ConventionallengthregularizationmayshortenCoTbycurtailingdeliberation, potentiallyharmingaccuracyand robustness. In contrast, Mobius yields far more refined and shorter responses through several rounds oflatent thought iteration.4.3. Architecture DesignMobius redesigns the internal information flow of Transformer architectures by decoupling knowledge storagefrom reasoning computation. In this section, we discuss its relationship with two major architectural directions:attention mechanisms and residual connections.4.3.1. Attention MechanismSelf-attention is the core component of Transformer architectures, enabling models to capture global depen-dencies through pairwise interactions among tokens [69]. However, the quadratic complexity of full attentionhas become a major bottleneck for scaling Transformer models to long-context scenarios. To address thisissue, extensive studies have explored more efficient attention mechanisms. Sparse attention reduces unnec-essary token interactions by restricting attention patterns, while linear attention reformulates the attentioncomputation to reduce complexity through alternative kernelization or factorization strategies. More recently,state-space models and gated state-space variants, such as Mamba and Gated Delta Networks, replace explicitattention computation with recurrent state updates, providing efficient alternatives for long-sequence model-ing [25, 78]. These approaches mainly improve efficiency by modifying the computation form or reducing thecost of information interaction.Rather than reducing attention complexity directly, we aim to increase the information density and valueextracted per attention operation. Specifically, by decoupling knowledge from reasoning and constructinga globally shared knowledge repository, Mobius incur higher retrieval costs but provide attention with amore flexible selection space and higher-quality inputs, thereby completing reasoning with a more compactcomputation trajectory.4.3.2. Residual ConnectionResidual connections are fundamental components for scaling deep neural networks, enabling stable optimiza-tion and effective information propagation through shortcut pathways [31]. Subsequent studies have exploredmore flexible connection patterns to improve information transmission across layers. Highway Networks intro-duce learnable gates to adaptively control information flow [66], while DenseNet increases connection densityby allowing each layer to directly access previous representations [35]. More recently, Hyper-Connections andAttention Residuals further investigate how to enhance residual pathways by increasing connection capacity ordynamically aggregating previous-layer representations [39, 80]. Despite these improvements, existing residual9
[[PDF PAGE 10]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoningenhancement methods mainly focus on strengthening forward information propagation, where informationflows from earlier layers to later layers.Mobius extends residual design from forward information propagation toward bidirectional knowledgeaccess, instead of explicitly expanding residual pathways. Since all reasoning stages can access the sameknowledge repository, deeper Reasoners can retrieve knowledge beyond their local layer hierarchy, enablingmore flexible information transmission while maintaining an efficient computation structure.5. Mobius’ potential on several highlight topics5.1. Self-EvolvingAlthough models and agents have grown increasingly capable, how to enable them to continuously absorb newknowledge and skills from external sources remains an open question [40, 56, 59, 72].Our position is that,the current Transformer architecture does not satisfy the prerequisites for self-evolution.Because knowledge and reasoning are tightly coupled in Transformer, such models can only acquirenew skills through end-to-end training, which inevitably alters both knowledge and reasoning capabilitiessimultaneously, thereby causing catastrophic forgetting of previously learned skills. An architecture suitablefor self-evolution should exhibit a certain degree of knowledge-reasoning decoupling, as this would supportunbounded and efficient expansion of knowledge storage, and enable the model’s reasoning capabilities togeneralize across multiple domains. The Mobius architecture we propose possesses preliminary knowledge-reasoning separation characteristics, demonstrating greater potential for continual learning compared toTransformer.Nevertheless, whether Mobius can perform better in real-world self-evolution scenarios still requires thejoint design of foundation models, agentic systems, and environmental feedback, and remains to be validatedin future work.5.2. World ModelWorld models are emerging as the next frontier beyond language models, yet how to enable models to performunderstanding and reasoning over continuous-space inputs remains an open question [6, 27–29, 33, 61].Our position is that,the current Transformer architecture does not satisfy the prerequisites for worldmodels.Models built primarily upon Transformer have been demonstrated to model discrete modalities (suchas language) at the terabyte parameter scale, yet perfect modeling of continuous space with Transformer wouldlikely require parameter scales on the order of petabytes. The inference cost of terabyte-scale language modelsalready strains existing hardware to its limits; the inference cost of a petabyte-scale world model would beastronomical. The Mobius architecture we propose natively supports latent reasoning, offering a stronger priorfor continuous-space modeling and demonstrating greater potential than Transformer.Nevertheless, the latent reasoning prior introduced by Mobius may prove far from sufficient; how to betterreengineer the attention mechanism may be of even greater criticality.5.3. Scientific DiscoveryContemporary AI has achieved remarkable proficiency in code and mathematics, and recent scientific foundationmodels excel at procedural problem-solving [5, 58]. Nevertheless, enabling models to formulate disruptivescientific hypotheses and ideas remains an open challenge [23, 48, 70].Our position is that,the current paradigm of Transformer architecture combined with long chains ofthought does not satisfy the prerequisites for scientific discovery.Under the present paradigm, modelsexcel at procedural problem-solving; however, scientific discovery demands not only procedural competencebut also scientific intuition and the composition and generalization of knowledge. The Mobius architectureaddresses this on two fronts: on one hand, it internalizes deliberation into a continuously differentiable latentspace [30, 64], affording the model the opportunity to develop more powerful intuition; on the other hand, itflattens all knowledge within the model, enabling a greater volume of knowledge to interact simultaneouslyand substantially increasing the possibility of compositional generalization across knowledge domains.10
[[PDF PAGE 11]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningNevertheless, whether Mobius can perform better in real-world scientific discovery scenarios likely requiresthe joint optimization of data, infrastructure, training algorithms, and optimization algorithms, and remains tobe validated in future work.5.4. Hardware-Software Co-DesignModels are being scaled to ever-larger parameter counts, demonstrating that greater scale does yield emergentintelligence, while simultaneously pushing the limits of physical hardware [6, 33, 37, 41, 57].Our position is that,the current combination of Transformer architecture and existing hardwaresystems does not satisfy the prerequisites for further scaling.This is because the Transformer architecturecommingles knowledge and reasoning within the same parameter set, necessitating the loading of nearlyall parameters into GPU memory at deployment. The Mobius architecture we propose exhibits knowledge-reasoning separation, opening the possibility of stably retaining only reasoning-dedicated parameters in GPUmemory while storing knowledge parameters predominantly on SSD, with high-priority knowledge retrievedand loaded into memory on demand.In the long term, Mobius is more amenable to hardware-software co-design than Transformer. However,substantial effort remains before this vision can be realized.11
[[PDF PAGE 12]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningReferences[1] Zeyuan Allen-Zhu. ICML 2024 Tutorial: Physics of Language Models, July 2024. Project page:https://physics.allen-zhu.com/. C[2] Zachary Ankner, Rishab Parthasarathy, Aniruddha Nrusimha, Christopher Rinard, Jonathan Ragan-Kelley,and William Brandon. Hydra: Sequentially-dependent draft heads for medusa decoding.arXiv preprintarXiv:2402.05109, 2024. 4.2.1[3] Simran Arora, Sabri Eyuboglu, Michael Zhang, Aman Timalsina, Silas Alberti, Dylan Zinsley, James Zou,Atri Rudra, and Christopher Ré. Simple linear attention language models balance the recall-throughputtradeoff, 2025. 1[4] Gedas Bertasius, Heng Wang, and Lorenzo Torresani. Is space-time attention all you need for videounderstanding? InICML, 2021. 1[5] Daniil A. Boiko, Robert MacKnight, Ben Kline, and Gabe Gomes. Autonomous chemical research withlarge language models.Nature, 624:570–578, 2023. 5.3[6] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, ArvindNeelakantan,PranavShyam,GirishSastry,AmandaAskell,SandhiniAgarwal,ArielHerbert-Voss,GretchenKrueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter,Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark,Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language modelsare few-shot learners. InNeurIPS, 2020. 5.2, 5.4[7] Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, and Tri Dao. Medusa:Simple llm inference acceleration framework with multiple decoding heads, 2024. 4.2.1[8] Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper.Accelerating large language model decoding with speculative sampling, 2023. 4.2.1[9] Jeffrey Cheng and Benjamin Van Durme. Compressed chain of thought: Efficient reasoning throughdense representations.arXiv preprint arXiv:2412.13171, 2024. 2.2, 4.2.2[10] Krzysztof Choromanski, Valerii Likhosherstov, Xingyou Song, Richard Davis, Kyle Sarlos, and AdrianWeller. Rethinking attention with performers. InICLR, 2021. 1[11] Muzhi Dai, Shixuan Liu, and Qingyi Si. Stable reinforcement learning for efficient reasoning, 2025. 4.2.2[12] Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. Universal trans-formers. InICLR. OpenReview.net, 2019. 4.1.2[13] Yuntian Deng, Yejin Choi, and Stuart Shieber. From explicit cot to implicit cot: Learning to internalizecot step by step.arXiv preprint arXiv:2405.14838, 2024. 4.2.2[14] Yuntian Deng, Kiran Prasad, Roland Fernandez, Paul Smolensky, Vishrav Chaudhary, and Stuart Shieber.Implicit chain of thought reasoning via knowledge distillation, 2023. 4.2.2[15] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirec-tional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio,editors,Proceedings of the 2019 Conference of the North American Chapter of the Association for Computa-tional Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186,Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. 1[16] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Un-terthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and NeilHoulsby. An image is worth 16x16 words: Transformers for image recognition at scale, 2021. 112
[[PDF PAGE 13]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning[17] NelsonElhage, NeelNanda, CatherineOlsson, TomHenighan, NicholasJoseph, BenMann, AmandaAskell,Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds,Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown,Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathematical framework for transformer cir-cuits.Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html.2[18] Mehdi Fatemi, Banafsheh Rafiee, Mingjie Tang, and Kartik Talamadupula. Concise reasoning via rein-forcement learning, 2025. 4.2.2[19] Jonas Geiping, Sean McLeish, Neel Jain, John Kirchenbauer, Siddharth Singh, Brian Bartoldson, BhavyaKailkhura, Abhinav Bhatele, and Tom Goldstein. Scaling up test-time compute with latent reasoning: Arecurrent depth approach. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, andN. Chen, editors,Advances in Neural Information Processing Systems, volume 38, pages 41340–41391.Curran Associates, Inc., 2025. 4.1.2[20] Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers are key-valuememories. In Marie-Francine Moens, Xuanjing Huang, Lucia Specia, and Scott Wen-tau Yih, editors,Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 5484–5495,Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics.2[21] Angeliki Giannou, Shashank Rajput, Jy yong Sohn, Kangwook Lee, Jason D. Lee, and Dimitris Papail-iopoulos. Looped transformers as programmable computers. InICML, pages 11398–11442, 2023. 2.2,4.1.2[22] Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Rozière, David Lopez-Paz, and Gabriel Synnaeve. Better &faster large language models via multi-token prediction. InProceedings of the 41st International Conferenceon Machine Learning, pages 15706–15734, 2024. 4.2.1[23] Juraj Gottweis, Wei-Hung Weng, Alexander Daryin, Tao Tu, et al. Accelerating scientific discovery withco-scientist.Nature, 655(8122):487–496, 2026. 5.3[24] SachinGoyal, ZiweiJi, AnkitSinghRawat, AdityaKrishnaMenon, SanjivKumar, andVaishnavhNagarajan.Think before you speak: Training language models with pause tokens. In B. Kim, Y. Yue, S. Chaudhuri,K. Fragkiadaki, M. Khan, and Y. Sun, editors,International Conference on Learning Representations, volume2024, pages 27896–27923, 2024. 4.1.3[25] Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. InFirstConference on Language Modeling, 2024. 1, 4.3.1[26] Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang,Shirong Ma, Xiao Bi, Xiaokang Zhang, Xingkai Yu, Yu Wu, Z. F. Wu, Zhibin Gou, Zhihong Shao, ZhuoshuLi, Ziyi Gao, Aixin Liu, Bing Xue, Bingxuan Wang, Bochao Wu, Bei Feng, Chengda Lu, Chenggang Zhao,Chengqi Deng, Chong Ruan, Damai Dai, Deli Chen, Dongjie Ji, Erhang Li, Fangyun Lin, Fucong Dai,Fuli Luo, Guangbo Hao, Guanting Chen, Guowei Li, H. Zhang, Hanwei Xu, Honghui Ding, HuazuoGao, Hui Qu, Hui Li, Jianzhong Guo, Jiashi Li, Jingchang Chen, Jingyang Yuan, Jinhao Tu, Junjie Qiu,Junlong Li, J. L. Cai, Jiaqi Ni, Jian Liang, Jin Chen, Kai Dong, Kai Hu, Kaichao You, Kaige Gao, KangGuan, Kexin Huang, Kuai Yu, Lean Wang, Lecong Zhang, Liang Zhao, Litong Wang, Liyue Zhang, LeiXu, Leyi Xia, Mingchuan Zhang, Minghua Zhang, Minghui Tang, Mingxu Zhou, Meng Li, Miaojun Wang,Mingming Li, Ning Tian, Panpan Huang, Peng Zhang, Qiancheng Wang, Qinyu Chen, Qiushi Du, Ruiqi Ge,Ruisong Zhang, Ruizhe Pan, Runji Wang, R. J. Chen, R. L. Jin, Ruyi Chen, Shanghao Lu, Shangyan Zhou,Shanhuang Chen, Shengfeng Ye, Shiyu Wang, Shuiping Yu, Shunfeng Zhou, Shuting Pan, S. S. Li, ShuangZhou, Shaoqing Wu, Tao Yun, Tian Pei, Tianyu Sun, T. Wang, Wangding Zeng, Wen Liu, Wenfeng Liang,Wenjun Gao, Wenqin Yu, Wentao Zhang, W. L. Xiao, Wei An, Xiaodong Liu, Xiaohan Wang, XiaokangChen, Xiaotao Nie, Xin Cheng, Xin Liu, Xin Xie, Xingchao Liu, Xinyu Yang, Xinyuan Li, Xuecheng Su,Xuheng Lin, X. Q. Li, Xiangyue Jin, Xiaojin Shen, Xiaosha Chen, Xiaowen Sun, Xiaoxiang Wang, XinnanSong, Xinyi Zhou, Xianzu Wang, Xinxia Shan, Y. K. Li, Y. Q. Wang, Y. X. Wei, Yang Zhang, Yanhong Xu,Yao Li, Yao Zhao, Yaofeng Sun, Yaohui Wang, Yi Yu, Yichao Zhang, Yifan Shi, Yiliang Xiong, Ying He,13
[[PDF PAGE 14]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningYishi Piao, Yisong Wang, Yixuan Tan, Yiyang Ma, Yiyuan Liu, Yongqiang Guo, Yuan Ou, Yuduan Wang,Yue Gong, Yuheng Zou, Yujia He, Yunfan Xiong, Yuxiang Luo, Yuxiang You, Yuxuan Liu, Yuyang Zhou,Y. X. Zhu, Yanping Huang, Yaohui Li, Yi Zheng, Yuchen Zhu, Yunxian Ma, Ying Tang, Yukun Zha, YutingYan, Z. Z. Ren, Zehui Ren, Zhangli Sha, Zhe Fu, Zhean Xu, Zhenda Xie, Zhengyan Zhang, Zhewen Hao,Zhicheng Ma, Zhigang Yan, Zhiyu Wu, Zihui Gu, Zijia Zhu, Zijun Liu, Zilin Li, Ziwei Xie, Ziyang Song,Zizheng Pan, Zhen Huang, Zhipeng Xu, Zhongyu Zhang, and Zhen Zhang. Deepseek-r1 incentivizesreasoning in llms through reinforcement learning.Nature, 645(8081):633–638, 2025. 2, 2.2, 4.2.2[27] David Ha and Jürgen Schmidhuber. World models. InAdvances in Neural Information Processing Systems,volume 31, 2018. 5.2[28] DanijarHafner, TimothyLillicrap, IanFischer, RubenVillegas, DavidHa, HonglakLee, andJamesDavidson.Learning latent dynamics for planning from pixels. InInternational Conference on Machine Learning,pages 2555–2565. PMLR, 2019.[29] Danijar Hafner, Jürgen Pasukonis, Jimmy Ba, and Timothy Lillicrap. Mastering diverse domains throughworld models.arXiv preprint arXiv:2301.04104, 2023. 5.2[30] Shibo Hao, Sainbayar Sukhbaatar, DiJia Su, Xian Li, Zhiting Hu, Jason Weston, and Yuandong Tian.Training large language models to reason in a continuous latent space.arXiv preprint arXiv:2412.06769,2024. 4.1.1, 5.3[31] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition.InProceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016.2, 2.1, 4.3.2[32] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks.InEuropean conference on computer vision, pages 630–645. Springer, 2016. 2.1[33] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford,Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland,Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan,Erich Elsen, Oriol Vinyals, Jack W. Rae, and Laurent Sifre. Training compute-optimal large languagemodels. InAdvances in Neural Information Processing Systems, volume 35, pages 30016–30030. CurranAssociates, Inc., 2022. 1, 1, 5.2, 5.4[34] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connectedconvolutional networks. InCVPR, pages 4700–4708, 2017. 2, 2.1[35] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connectedconvolutional networks. InProceedings of the IEEE Conference on Computer Vision and Pattern Recognition,pages 4700–4708, 2017. 4.3.2[36] Yu Kang, Xianghui Sun, Liangyu Chen, and Wei Zou. C3ot: Generating shorter chain-of-thought withoutcompromising effectiveness. InProceedings of the AAAI Conference on Artificial Intelligence, volume 39,pages 24312–24320, 2025. 4.2.2[37] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray,Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models, 2020. 1, 1, 5.4[38] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are rnns: Fastautoregressive transformers with linear attention. InICML, pages 5156–5165, 2020. 1[39] Kimi Team. Attention residuals.arXiv preprint arXiv:2603.15031, 2026. 2.1, 4.3.2[40] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu,Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophicforgetting in neural networks.Proceedings of the National Academy of Sciences, 114(13):3521–3526, 2017.5.114
[[PDF PAGE 15]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning[41] Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez,Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving withpagedattention. InProceedings of the 29th Symposium on Operating Systems Principles, pages 611–626.ACM, 2023. 5.4[42] Yaniv Leviathan, Matan Kalman, and Yossi Matias. Fast inference from transformers via speculativedecoding. InInternational Conference on Machine Learning, pages 19274–19286. PMLR, 2023. 4.2.1[43] Xiang Li, John Thickstun, Ishaan Gulrajani, Percy S Liang, and Tatsunori B Hashimoto. Diffusion-lmimproves controllable text generation. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, andA. Oh, editors,Advances in Neural Information Processing Systems, volume 35, pages 4328–4343. CurranAssociates, Inc., 2022. 2.2, 4.1.3[44] Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang. Eagle: speculative sampling requiresrethinking feature uncertainty. InProceedings of the 41st International Conference on Machine Learning,pages 28935–28948, 2024. 4.2.1[45] Hunter Lightman, Vineet Kosaraju, Yura Burda, Harri Edwards, Bowen Baker, Teddy Lee, Jan Leike, JohnSchulman, Ilya Sutskever, and Karl Cobbe. Let’s verify step by step, 2023. 1, 2.2[46] Aiwei Liu, Cheng Shi, Chuhan Wu, Ci Lei, Di Lu, Donald He, Fan Zhang, Fanhao Kong, Feifei Zhang,Guan Wang, et al. Hidden decoding at scale: Latent computation scaling for large language models.arXivpreprint arXiv:2607.08186, 2026. 4.1.3[47] Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, ChengqiDeng, Chenyu Zhang, Chong Ruan, et al. Deepseek-v3 technical report.arXiv preprint arXiv:2412.19437,2024. 4.2.1[48] Chris Lu, Cong Lu, Robert Tjarko Lange, Jakob Foerster, Jeff Clune, and David Ha. The ai scientist:Towards fully automated open-ended scientific discovery, 2024. 5.3[49] Wenjie Ma, Jingxuan He, Charlie Snell, Tyler Griggs, Sewon Min, and Matei Zaharia. Reasoning modelscan be effective without thinking, 2025. 1[50] Xinyin Ma, Guangnian Wan, Runpeng Yu, Gongfan Fang, and Xinchao Wang. Cot-valve: Length-compressible chain-of-thought tuning. InProceedings of the 63rd Annual Meeting of the Associationfor Computational Linguistics (Volume 1: Long Papers), pages 6025–6035, 2025. 4.2.2[51] Somesh Mehra, Javier Alonso Garcia, and Lukas Mauch. On multi-token prediction for efficient llminference, 2025. 4.2.1[52] Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associationsin gpt. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, editors,Advances in NeuralInformation Processing Systems, volume 35, pages 17359–17372. Curran Associates, Inc., 2022. 2[53] Xupeng Miao, Gabriele Oliaro, Zhihao Zhang, Xinhao Cheng, Zeyu Wang, Zhengxin Zhang, Rae Ying YeeWong, Alan Zhu, Lijie Yang, Xiaoxiang Shi, et al. Specinfer: Accelerating large language model servingwith tree-based speculative inference and verification. InProceedings of the 29th ACM InternationalConference on Architectural Support for Programming Languages and Operating Systems, Volume 3, pages932–949, 2024. 4.2.1[54] Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettle-moyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. s1: Simple test-time scaling. InChristos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, and Violet Peng, editors,Proceedings ofthe 2025 Conference on Empirical Methods in Natural Language Processing, pages 20275–20321, Suzhou,China, November 2025. Association for Computational Linguistics. 1[55] Shen Nie, Fengqi Zhu, Zebin You, Xiaolu Zhang, Jingyang Ou, Jun Hu, Jun Zhou, Yankai Lin, Ji-RongWen, and Chongxuan LI. Large language diffusion models. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu,P. Koniusz, M. Ghassemi, and N. Chen, editors,Advances in Neural Information Processing Systems,volume 38, pages 50608–50646. Curran Associates, Inc., 2025. 2.2, 4.1.315
[[PDF PAGE 16]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning[56] German I. Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual lifelonglearning with neural networks: A review.Neural Networks, 113:54–71, 2019. 5.1[57] Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. Zero: Memory optimizations towardtraining trillion parameter models. InSC20: International Conference for High Performance Computing,Networking, Storage and Analysis, pages 1–16. IEEE, 2020. 5.4[58] Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. PawanKumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan Ellenberg, et al. Funsearch: Making new discoveriesin mathematical sciences using large language models.Nature, 625:468–475, 2024. 5.3[59] Adam Santoro, Sergey Bartunov, Matthew M. Botvinick, Daan Wierstra, and Timothy P. Lillicrap. One-shotlearning with memory-augmented neural networks.CoRR, abs/1605.06065, 2016. 5.1[60] Nikunj Saunshi, Nishanth Dikkala, Zhiyuan Li, Sanjiv Kumar, and Sashank J. Reddi. Reasoning with latentthoughts: On the power of looped transformers. In Y. Yue, A. Garg, N. Peng, F. Sha, and R. Yu, editors,International Conference on Learning Representations, volume 2025, pages 14855–14881, 2025. 4.1.2[61] Julian Schrittwieser, Ioannis Antonoglou, Thomas Hubert, Karen Simonyan, Laurent Sifre, Simon Schmitt,Arthur Guez, Edward Lockhart, Demis Hassabis, David Silver, et al. Mastering atari, go, chess and shogiby planning with a learned model.Nature, 588:604–609, 2020. 5.2[62] Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, MingchuanZhang, Y. K. Li, Y. Wu, and Daya Guo. Deepseekmath: Pushing the limits of mathematical reasoning inopen language models, 2024. 4.2.2[63] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and JeffDean. Sparsely-gated mixture-of-experts layers. InICLR, 2017. 2.3[64] Zhenyi Shen, Hanqi Yan, Linhai Zhang, Zhanghao Hu, Yali Du, and Yulan He. CODI: Compressingchain-of-thought into continuous space via self-distillation. In Christos Christodoulopoulos, TanmoyChakraborty, Carolyn Rose, and Violet Peng, editors,Proceedings of the 2025 Conference on EmpiricalMethods in Natural Language Processing, pages 677–693, Suzhou, China, November 2025. Association forComputational Linguistics. 4.1.1, 5.3[65] Mingyang Song and Mao Zheng. Walk before you run! concise llm reasoning via reinforcement learning,2025. 4.2.2[66] Rupesh K. Srivastava, Klaus Greff, and Jürgen Schmidhuber. Training very deep networks. InAdvances inNeural Information Processing Systems, pages 2377–2385, 2015. 4.3.2[67] Rupesh K. Srivastava, Klaus Greff, and Jürgen Schmidhuber. Highway networks. InICML Deep LearningWorkshop, 2015. 2[68] Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressivemodels.Advances in Neural Information Processing Systems, 31, 2018. 4.2.1[69] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukaszKaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach,R. Fergus, S. Vishwanathan, and R. Garnett, editors,Advances in Neural Information Processing Systems,volume 30. Curran Associates, Inc., 2017. 1, 2, 4.3.1[70] Yuru Wang, Lejun Cheng, Yuxin Zuo, Sihang Zeng, Bingxiang He, Che Jiang, Junlin Yang, Yuchong Wang,Kaikai Zhao, Weifeng Huang, Kai Tian, Zhenzhao Yuan, Jincheng Zhong, Weizhi Wang, Ning Ding, BowenZhou, and Kaiyan Zhang. Naturebench: Can coding agents match the published sota of nature-familypapers?, 2026. 5.3[71] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le,and Denny Zhou. Chain-of-thought prompting elicits reasoning in large language models. InNeurIPS,2022. 1, 2, 2.2, 4.1[72] Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks. InICLR, 2015. 5.116
[[PDF PAGE 17]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and Reasoning[73] Heming Xia, Chak Tou Leong, Wenjie Wang, Yongqi Li, and Wenjie Li. Tokenskip: Controllable chain-of-thought compression in llms. InProceedings of the 2025 Conference on Empirical Methods in NaturalLanguage Processing, pages 3351–3363, 2025. 4.2.2[74] Zhenda Xie, Yixuan Wei, Huanqi Cao, Chenggang Zhao, Chengqi Deng, Jiashi Li, Damai Dai, HuazuoGao, Jiang Chang, Kuai Yu, Liang Zhao, Shangyan Zhou, Zhean Xu, Zhengyan Zhang, Wangding Zeng,Shengding Hu, Yuqing Wang, Jingyang Yuan, Lean Wang, and Wenfeng Liang. mhc: Manifold-constrainedhyper-connections, 2026. 2.1[75] Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan,Liwei Wang, and Tieyan Liu. On layer normalization in the transformer architecture. InInternationalconference on machine learning, pages 10524–10533. PMLR, 2020. 2.1[76] Yige Xu, Xu Guo, Zhiwei Zeng, and Chunyan Miao. SoftCoT: Soft chain-of-thought for efficient reasoningwith LLMs. In Wanxiang Che, Joyce Nabende, Ekaterina Shutova, and Mohammad Taher Pilehvar, editors,Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: LongPapers), pages 23336–23351, Vienna, Austria, July 2025. Association for Computational Linguistics. 4.1.1[77] Shiming Yang, Yuxuan Tong, Xinyao Niu, Graham Neubig, and Xiang Yue. Demystifying long chain-of-thought reasoning. InInternational Conference on Machine Learning, pages 71177–71209. PMLR, 2025.4.2.2[78] Songlin Yang, Jan Kautz, and Ali Hatamizadeh. Gated delta networks: Improving mamba2 with deltarule. InThe Thirteenth International Conference on Learning Representations, 2025. 1, 4.3.1[79] Ping Yu, Jing Xu, Jason Weston, and Ilia Kulikov. Distilling system 2 into system 1, 2024. 4.2.2[80] Defa Zhu, Hongzhi Huang, Zihao Huang, Yutao Zeng, Yunyao Mao, Banggu Wu, Qiyang Min, and XunZhou. Hyper-connections. InInternational Conference on Learning Representations, 2025. 2.1, 4.3.2[81] Yicheng Zou et al. Intern-s1-pro: Scientific multimodal foundation model at trillion scale, 2026. 117
[[PDF PAGE 18]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningA. Author ListA.1. Core Contributors (Sorted by Contribution)Algorithm Design:• Architecture:Ermo Hua *, Xiangyu Hong*, Che Jiang*, Baiting Wu, Cheng Liang, Youbang Sun, Biqing Qi,Qipeng Guo• Training:Baiting Wu *, Chengqi Lv*, Ermo Hua*, Xiangyu Hong*, Weida Wang, Ning Ding, Wenwei ZhangInfrastructure:• Training:Hanjing Wang*, Xiangyu Hong*, Yicheng Gu*, Ermo Hua*, Shan Yu, Haozheng Hou, JianminQian, Jie Hou, Zhongbo Tian, Hui Wang• Inference:Qian Yao *, Baiting Wu*, Ermo Hua*, Jifeng Ding, Ningsheng Ma, Han Lv, Minxi Jin, ZhongboTian, Hui WangProject Leader:Ermo HuaProject Advisors:Qi Zhang, Kai Chen, Dahua Lin, Bowen ZhouA.2. Full List (Sorted by Character)Kai Chen, Jifeng Ding, Ning Ding, Jiaye Ge, Lixin Gu, Yicheng Gu, Qipeng Guo, Ermo Hua, Haian Huang,Haozheng Hou, Jie Hou, Xiangyu Hong, Che Jiang, Minxi Jin, Cheng Liang, Dahua Lin, Dawei Liu, Kuikun Liu,Chengqi Lv, Haijun Lv, Han Lv, Ningsheng Ma, Biqing Qi, Jianmin Qian, Shiya Su, Youbang Sun, Huanze Tang,Zhongbo Tian, Hanjing Wang, Rui Wang, Ting Wang, Yi Wang, Baiting Wu, Jun Xu, Bowen Yang, Hui Wang,Weida Wang, Haochen Ye, Jiashuo Yu, Shan Yu, Xiaoyi Yu, Qirui Zeng, Qi Zhang, Ming Zhang, Wenwei Zhang,Bowen Zhou, Xinyu ZhouB. Expert Activation PatternsWe further compare expert-activation pattern under two training recipes introduced in 3. As shown in 6, theMobius-7B model trained from scratch (left) exhibits a comparatively uniform activation distribution acrossreasoning layers. Intern-S2-Mobius-35B (right), continually pre-trained from Qwen3.5-35B, activates expertsover a wider range while retaining a pronounced block-diagonal pattern. The latter suggests that expert routingremains influenced by the layer-specific organization of the source checkpoint.These observations suggest that continual pre-training can broaden expert utilization without fully removingthe routing prior induced by architectural conversion. Training Mobius from scratch may therefore permitmore flexible access to the shared expert pool; whether this translates into stronger model capability requirescontrolled evaluation at comparable scale.C. Toy Task of Compositional GeneralizationWe select a Compositional Generalization task from Physics of LLM [1]. On this task, we compared Transformeragainst our yet-to-be-released, newer Mobius architecture. As shown in Fig 7, Mobius achieved substantiallybetter convergence efficiency and final scores. This compositional generalization task uses single-hop knowledgeof 500 entities and two-hop knowledge of 400 entities as the training set, and two-hop knowledge of theremaining 100 entities as the test set. By comparing test-set scores, we examine whether the model cangenuinely learn the connections between different knowledge pieces and achieve compositional generalization.D. Case Study: Chain-of-Thought ReasoningWe further present an example from the field of biology in 3. In this case, Mobius also delivers a mush shorterreasoning trace than Transformer.18
[[PDF PAGE 19]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningFigure6: Expert-Activation pattern across layers under two training recipes. The left panel shows Mobius-7Btrained from scratch; the right panel shows Intern-S2-Mobius-35B obtained by architecture conversion andcontinual pre-training. Rows denote expert IDs, columns denote layer indices, and color represents the base-10logarithm of selection frequency. Expert IDs in the right panel are reordered to reveal the inherited routingstructure.E. Layerwise Analysis of Latent ReasoningWe use a layerwise prediction lens to examine how token predictions evolve during latent computation.Given the same teacher-forced context, we decode the hidden state at each layer for the standard next-tokenprediction (𝑡+ 1) and four subsequent MTP positions (𝑡+ 2 to 𝑡+ 5). As shown in Figure 8, Mobius exhibits moreinterpretable, target-aligned predictions in its intermediate layers than the baseline. Its layerwise predictionsfollow a more coherent semantic trajectory, suggesting that task-relevant information is concentrated intoa compact internal representation rather than dispersed across competing token candidates. Further latentiterations progressively refine this representation and improve predictions at subsequent positions, ultimatelyyielding a fully accepted five-token draft. In contrast, the baseline exhibits less stable intermediate predictions,and its draft is rejected at the third predicted position, leaving only a two-token accepted prefix. This examplesuggests that Mobius may form more compact internal representations and refine them iteratively in latentspace, potentially benefiting multi-token prediction.19
[[PDF PAGE 20]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningMadison FrederickNoeGrahamismentorofQ:WhoisthementorofmanagerofJaylaStanley?A:NoeGraham.Madison FrederickJaylaStanleyismanagerof(a)TaskDescription (a)PerformanceFigure7: The Compositional Generalization task selected from Physics of LLM. A future-version of Mo-bius(unreleased) enjoys faster convergence, higher final scores than Transformer. The train set contains500-entity single-hop + 400-entity two-hop, while the test set contains 100-entity two-hop holdout. This taskevaluates whether models learn cross-knowledge connections, not mere memorization.Figure8: Layerwise prediction lens for Mobius and the Qwen3.5 baseline under an identical teacher-forcedcontext. The 𝑡+ 1 column represents standard next-token prediction, while𝑡+ 2 through 𝑡+ 5 are subsequentMTP predictions. Each cell shows the token predicted from a given hidden-state view; color intensity denotesits probability, and a black outline marks agreement with the target continuation. Mobius exhibits moretarget-aligned intermediate predictions and produces a five-token draft accepted in full, while the baselineproduces only a two-token accepted prefix.20
[[PDF PAGE 21]]Intern-S2-Mobius: Foundation Model with Decoupled Knowledge and ReasoningTable3: Step-aligned comparison between Intern-Spin-35B and Qwen3.5-35B on a photosynthesis multiple-choice question. Both models select the correct answer (Option D). Token counts are computed using theQwen3.5-35B tokenizer.Reasoning Trace ComparisonAligned Step Intern-Spin-35B Qwen3.5-35BTask framing36 tokens.“The user is asking a question about therelationship between the light reactionsand the Calvin cycle in photosynthesis.”35 tokens.“The user wants me to answer ...Question:The light reactions ... supplythe Calvin cycle with which of thefollowing?”Core biological mechanism108 tokens.“Light-dependentreactions... producingoxygen, ATP, and NADPH.”“Calvin cycle ... uses ATP and NADPH... to fix𝐶𝑂 2 into sugars.”276 tokens.“Light-dependent reactions ... Outputs:Oxygen (𝑂2), ATP, NADPH. ... CalvinCycle ... Inputs:𝐶𝑂 2, ATP, NADPH.”“... reduction requires ATP and NADPH...”Option evaluation240 tokens.“D: ATP provides energy, NADPHprovides high-energy electrons ...”“H: ATP and NADPH are produced inlight reactions, not broken down there...”543 tokens.“D ... Correct. The light reactionsgenerate ATP (energy) and NADPH(reducing power/electrons). ...”“H ... ATP and NADPH are produced inthe light reactions and consumed ... inthe Calvin cycle.”Repeated derivation —205 tokens.“Conclusion:Option D accuratelydescribes the relationship ... ATP andNADPH ... are used in the Calvin cycleto fix carbon.”“Step-by-step derivation:... LightReactions produce ATP and NADPH→Calvin Cycle consumes them. ...”Repeated option check —143 tokens.“Final check:... Option A:𝐶𝑂 2 sourceis wrong. ... Option D: ATP/NADPHtransfer is correct. ...”Reasoning closure13 tokens.“Conclusion: Option D is the correctanswer.”8 tokens.“The correct option is D.”Visible final answer75 tokens.“The light reactions ... stored in ATPand NADPH. These molecules are thenused in the Calvin cycle ...”“ANSWER: D”439 tokens.“The process of photosynthesis is dividedinto two main stages ... ATP andNADPH ... are transported to the Calvincycle.”“... D: This states ATP and NADPH aresupplied. This is accurate. ...”“ANSWER: D”Total 472 tokens 1,649 tokensNote:The token counts are sequential marginal counts over each raw prediction; therefore, they sum exactly to the total outputlength. The displayed excerpts are representative original text from the corresponding reasoning segment. Ellipses indicateomitted original text.21123version https://git-lfs.github.com/spec/v1oid sha256:7c2c7ae4d335e8bcf6e6b2fd5a1795eaedbd038375b025d7aeed2a7f4c8d1bb8size 587752123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515[[PDF PAGE 1]]Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing , pages 15686–15702December 6-10, 2023 ©2023 Association for Computational LinguisticsMQUAKE: Assessing Knowledge Editing inLanguage Models via Multi-Hop QuestionsZexuan Zhong†∗, Zhengxuan Wu‡∗,Christopher D. Manning‡, Christopher Potts‡ and Danqi Chen††Princeton University ‡Stanford University{zzhong,danqic}@cs.princeton.edu {wuzhengx,manning,cgpotts}@stanford.eduAbstractThe information stored in large language mod-els (LLMs) falls out of date quickly, and re-training from scratch is often not an option.This has recently given rise to a range of tech-niques for injecting new facts through updatingmodel weights. Current evaluation paradigmsare extremely limited, mainly validating therecall of edited facts, but changing one factshould cause rippling changes to the model’srelated beliefs. If we edit the UK Prime Min-ister to now be Rishi Sunak , then we shouldget a different answer to Who is married tothe British Prime Minister? In this work, wepresent a benchmark, MQUAKE (Multi-hopQuestion Answering for Knowledge Editing),comprising multi-hop questions that assesswhether edited models correctly answer ques-tions where the answer should change as anentailed consequence of edited facts. While wefind that current knowledge-editing approachescan recall edited facts accurately, they fail catas-trophically on the constructed multi-hop ques-tions. We thus propose a simple memory-basedapproach, MeLLo, which stores all edited factsexternally while prompting the language modeliteratively to generate answers that are consis-tent with the edited facts. While MQUAKE re-mains challenging, we show that MeLLo scaleswell with LLMs (up to 175B) and outperformsprevious model editors by a large margin.11 IntroductionAs large language models (LLMs) are deployedwidely, the need to keep their knowledge correctand up-to-date without massive retraining costsbecomes increasingly important (Sinitsin et al.,2020). Prior work has proposed knowledge editingmethods to incrementally inject a set of new factsinto a language model (Zhu et al., 2021; De Caoet al., 2021; Meng et al., 2022a,b; Mitchell et al.,*Equal contribution.1Our datasets and code are publicly available at https://github.com/princeton-nlp/MQuAKE.New Fact: The current British Prime Minister is Rishi Sunak.Who is the current British Prime Minister?Who is married to the British Prime Minister?RecallEdited FactBoris Johnson Rishi SunakCarrie Johnson Carrie JohnsonModel Before EditModel After EditOurQuestionWho is currently the head of the British government?RecallRelated FactBoris Johnson Rishi SunakFigure 1: An example of our benchmark MQUAKE .Existing knowledge-editing methods often perform wellat answering paraphrased questions of the edited factbut fail on multi-hop questions that are entailed conse-quences of the edited fact.2022a,b), but it is not yet clear whether these meth-ods provide a viable solution of updating and main-taining deployed LLMs.To evaluate these methods, existing benchmarksoften focus on measuring whether the edited modelcan recall the newly injected facts and whether un-related knowledge remains unchanged post-editing.However, a vital unaddressed question is whetherthe edited model can handle questions where the an-swer should change as an entailed consequence ofedited facts. For example (see Figure 1), if we up-date the British Prime Minister from Boris Johnsonto Rishi Sunak within a model, the answer to Whois married to the British Prime Minister? shouldalso change as a consequence of this edit.Therefore, we propose MQUAKE (Multi-hopQuestion Answering for Knowledge Editing), anew benchmark for a more complete evaluationof knowledge-editing methods. Each example inMQUAKE consists of a multi-hop question (in-cluding{2, 3, 4}-hop questions) which correspondsto a chain of facts. When we edit one or a few factsin a chain, the edited model needs to propagatethe change to entailed consequences of the editedfacts. MQUAKE includes a dataset MQUAKE- CF15686
[[PDF PAGE 2]]based on counterfactual edits, and another datasetMQUAKE- T of temporal knowledge updates toevaluate model editors on real-world changes.We evaluate state-of-the-art knowledge-editingmethods on MQUAKE , testing from editing factsmentioned in one question to editing facts men-tioned in a large set of questions. The latter settingevaluates approaches that are designed to handlemany edits, such as MEMIT (Meng et al., 2022b).Surprisingly, existing knowledge-editing methodsoften perform well on answering questions that areparaphrases of the edited fact but fail drasticallyon questions where the answer should change asa consequence of an edited fact. For example, aGPT-J model edited by ROME (Meng et al., 2022a)can only answer 7.6% of multi-hop questions inMQUAKE- CF, even though it could answer43.4%of the questions before editing.Towards faithful knowledge editing, we proposea simple but effective method, MeLLo, that sig-nificantly outperforms existing model editors evenwith a large number of edits. Instead of updatingmodel weights, MeLLo stores edits in an explicitmemory inspired by memory-based editing meth-ods (Mitchell et al., 2022b) and prompts the lan-guage model iteratively to interact with the editedfacts. Specifically, it decomposes a multi-hop ques-tion into sub-questions successively, generates ten-tative answers, and checks whether it is consistentwith edited facts before returning the final answer.Such a method does not require any additional train-ing, and can be easily scaled up to large LMs suchas GPT-3 (Brown et al., 2020; Ouyang et al., 2022)unlike methods requiring weight updates. We hopethat both our benchmark and proposed methodprovide additional insights into building faithfulknowledge-editing methods.2 Problem DefinitionThis section introduces our setting and argues thata model edit is only truly successful if the editedmodel also returns new correct answers for ques-tions that change as a consequence of the edits.2.1 Querying Factual Knowledge in LLMsWe represent a fact as a triple (s, r, o), consist-ing of a subject ( s), a relation ( r), and an object(o), and manually construct a natural languageprompt template tr(⋅) for each type of relationr as a way of querying knowledge from a lan-guage model (Petroni et al., 2019). This templatetakes a subject s as input and generates a ques-tion or a cloze-style statement tr(s). For instance,given the subject United Kingdom and the relationhead of government, we can form a cloze sentenceThe Prime Minister of the United Kingdom is __ .We consider an autoregressive language modelf ∶ X → Y, which takes a piece of text x∈ X as in-put and predicts y ∈ Y, the continuation ofx. Givena fact triple (s, r, o), we can query the languagemodel to recall the fact by feeding the prompttr(s)as input and matching the output f(tr(s)) withthe object o. While prior work has studied howto prompt to extract more knowledge (Jiang et al.,2020; Shin et al., 2020; Zhong et al., 2021), we sim-ply use manually-written templates, as enhancingknowledge retrieval is not our focus.2.2 Knowledge EditingThe knowledge stored in a language model canbe incorrect or become outdated over time. Onepossible solution is to edit the knowledge on thefly without retraining. A fact edit is defined as apair of fact triples that share the same subject andrelation e= ((s, r, o),(s, r, o∗)), which representsthe associated object is updated from o to o∗. Forsimplicity, we abbreviate the notation for an edit ase= (s, r, o → o∗) throughout the paper.Given a collection of fact edits E = {e1, e2, . . .}and a language model f, knowledge editing in-volves learning a function K ∶ F × E → F thatyields an edited language model f∗ ∶ X → Y,K(f, E) = f∗. For the methods we assess in Sec-tion 4, K modifies the weights of f in an attempt toincorporate E. Our proposed alternative, MeLLo,is much more lightweight: it keeps f frozen andinstead uses E as an external knowledge store toguide generation (Section 5).In previous work (De Cao et al., 2021; Mitchellet al., 2022a,c; Meng et al., 2022a,b), the evaluationfocuses on assessing whether the edited model re-calls the updated knowledge and whether unrelatedknowledge remains unchanged post-editing. Toevaluate whether a “single-hop” edit e= (s, r, o →o∗) is successful with an edited model f∗(⋅), exist-ing paradigms assess whether f∗(tr(s)) is equalto o∗ (or assigns o∗ a high probability). Addition-ally, they check correctness by varying tr(s) whilekeeping semantic equivalence (Meng et al., 2022b).2.3 Evaluation of Multi-hop QuestionsBy only evaluating single-hop questions, exist-ing methods were tested for recalling edited facts.15687
[[PDF PAGE 3]]It remains unknown whether an edited modelcan handle a question where the answer shouldchange as an entailed consequence of an editedfact. We propose to evaluate edited models withmulti-hop questions by considering a chain offacts C = ⟨(s1, r1, o1), . . . ,(sn, rn, on)⟩, wherethe object of ith fact also serves as the subjectof the next fact in the chain, i.e., oi = si+1. Wedenote R = [r1, . . . , rn] as the relation set andS = [s1, . . . , sn] as the subject set. We then use Cto construct a multi-hop question that asks aboutthe head entity s1, with the answer being the tailentity on. Similar to a single-hop question, wegenerate a question as tR(S). For example, witha chain consisting of two facts ( United Kingdom,head of government, Boris Johnson), (Boris John-son, spouse, Carrie Johnson), one can write a 2-hop question Who is married to the British PrimeMinister? Once one or more facts in the chain areedited, e.g., (United Kingdom, head of government,Boris Johnson → Rishi Sunak), the language modelhas to leverage the updated knowledge to answerthe question, which we posit as a crucial indicatorof a model faithfully updating the fact.3 MQ UAKE: Multi-hop QuestionAnswering for Knowledge EditingWe construct the benchmark MQUAKE (Multi-hop Question Answering for Knowledge Editing),which contains two datasets. The first, MQUAKE-CF, is designed as a diagnostic dataset for the evalu-ation of knowledge editing methods on counterfac-tual edits. The second, MQUAKE- T, comprisestemporal-based knowledge updates and is intendedto assess the effectiveness of knowledge editingmethods in updating outdated information with cur-rent, real facts. We first present the data construc-tion process for MQUAKE- CF and MQUAKE- T.Then, we present the data statistics and evaluationsettings, followed by evaluation metrics in the end.3.1 Data Construction of MQ UAKE- CFSampling chains of facts Our dataset is con-structed based on Wikidata (Vrande ˇci´c andKrötzsch, 2014), a knowledge base consisting offact triples associated with millions of entities. Wefirst sample chains of facts from Wikidata. We man-ually select 37 common relations and consider asubgraph that solely comprises these relations andthe top 20% of common entities based on hyperlinkcounts in Wikipedia articles. 2 We collect chainsthat contain N = 2, 3, 4 triples from the Wikidatasubgraph. We also adopt heuristics rules to ensurethat the sampled fact triples are coherent and leadto natural questions (see Appendix A.1 for details).Filtering unrecallable facts As answering multi-hop questions requires the model to leverage eachsingle-hop fact, we filter out any chain of factswhich contain at least one fact that cannot be re-called by GPT-J (Wang and Komatsuzaki, 2021),which we will mainly evaluate on. To recall single-hop facts, we curate a question template for eachrelation type following prior work (Petroni et al.,2019; Meng et al., 2022a), and query the modelusing in-context learning with 8 demonstration ex-amples (see Appendix A.2 for more details).Generating multi-hop questions Given C =⟨(s1, r1, o1), . . . ,(sn, rn, on)⟩, we aim to write aset of questions Q about the head entity s1 with thegold answer a being the tail entity oN. We leverageChatGPT (gpt-3.5-turbo) to automatically gen-erate questions given a chain of facts C, because(1) this provides us more diverse question formatsof good quality; (2) it is challenging to manuallywrite question templates for all the different types.We prompt ChatGPT to generate three questionsfor each sampled chain of facts. We include theprompt we used and examples of generated multi-hop questions in Appendix A.3.Sampling counterfactual edits So far, wehave collected ⟨Q, a,C⟩ (questions, answer, facttriples) for each instance in the dataset. Next,we sample counterfactual edits E and col-lect the corresponding fact triples C∗ and an-swer a∗. Given a chain of n factual triples C =⟨(s1, r1, o1), . . . ,(sn, rn, on)⟩, we randomly sam-ple t ∈ {1, . . . , N} counterfactual edits in C. Fora triple (s, r, o), we sample a counterfactual ob-ject o∗ from all possible objects that are related torelation r. We replace (s, r, o) with (s, r, o∗) inthe chain and update other facts accordingly. Wemake sure that, after injecting counterfactual ed-its, the new chain still exists so that we are ableto find an updated answer a∗. We only keep thesampled edits if the corresponding updated answera∗ is not identical to the original one a. We use thesame filtering process as Appendix A.2 to make2We focus on common entities as LMs can recall factsabout common entities more reliably (Mallen et al., 2023).15688
[[PDF PAGE 4]]E (W ALL-E, creator, Andrew Stanton→ James Watt)(University of Glasgow, headquarters location,Glasgow → Beijing)Q In which city is the headquarters of the employer ofW ALL-E’s creator located?What is the location of the headquarters of the companythat employed the creator of W ALL-E?Where is the headquarters of the company that employedthe creator of W ALL-E situated?a Emeryvillea∗ BeijingC (W ALL-E, creator, Andrew Stanton)(Andrew Stanton, employer, Pixar)(Pixar, headquarters location, Emeryville)C∗::::::::::(W ALL-E,:::::::creator, ::::::James :::::Watt)(James Watt, employer, University of Glasgow)::::::::::(University::of:::::::::Glasgow,::::::::::::headquarters ::::::::location,::::::::Beijing)Table 1: An instance in the MQUAKE- CF dataset,which consists of an edit set E, a set of three multi-hopquestions Q, the desirable answer pre- and post-editinga, a∗, and the chain of facts pre- and post-editing C, C∗.The edited facts are marked as ::(s,::r, :::o∗).#Edits 2-hop 3-hop 4-hop TotalMQUAKE- CF1 2,454 855 446 3,7552 2,425 853 467 3,7453 - 827 455 1,2824 - - 436 436All 4,879 2,535 1,804 9,218MQUAKE- T 1 (All) 1,421 445 2 1,868Table 2: Data statistics of MQUAKE.sure GPT-J can recall all unedited single-hop factsin the chains.3.2 Data Construction of MQ UAKE- TFollowing a similar procedure to buildingMQUAKE- CF, we construct the other segment:MQUAKE- T, focusing on temporal-based, real-world fact updates. We take two dumps of Wiki-data: 2021-04 and 2023-04, and obtain the differ-ences between the two versions. We find that mostchanges in Wikidata come from schema changes,i.e., ( Encyclopédie, instance of , encyclopedia →written work) instead of actual fact updates. Wethen manually select 6 relations where the changesare most likely to align with real fact changes, e.g.,(United Kingdom, head of government, Boris John-son → Rishi Sunak). Similarly, we sample chains offacts and filter out unrecallable facts using GPT-J.When we generate edits given a fact chain, insteadof sampling artificial counterfactual facts, we re-quire that edits come from the diff set between thetwo versions of Wikidata. Note that different fromMQUAKE- CF, each instance in MQUAKE- T re-lates to only one edit, because all the edits are aboutposition changes (e.g., head of state) and involvingtwo in a question is not coherent. The goal of thisdataset is to evaluate how successfully edited lan-guage models can answer questions which involveauthentic updates to real-world knowledge.3.3 Dataset SummaryDataset format As shown in Table 1, each in-stance in the MQUAKE dataset is denoted by a tu-ple d= ⟨E, Q, a, a∗, C, C∗⟩, where E is a set of editsthat we want to inject into the language model, Qrepresents multi-hop questions we use to evaluateediting methods (we provide three multi-hop ques-tions), a and a∗ denote the correct answer beforeand after edits, and C and C∗ correspondingly repre-sent the factual triples associated with this questionbefore and after editing. A desirable knowledgeediting method will inject all the edits in E into themodel, and enable the model to internally use theedits and answer the questions.Data statistics Table 2 summarizes the statisticsof the MQUAKE- CF and MQUAKE- T datasets.The MQUAKE- CF dataset consists of more than9K N-hop questions (N ∈ {2, 3, 4}), each of whichassociates with one or more edits. 3 We regardit as a diagnostic dataset to study the ability ofedited models leveraging newly injected knowl-edge through editing methods. The MQUAKE- Tdataset includes 1.8K instances, each of them asso-ciates with one real-world fact change.Number of edited facts We consider two eval-uation scenarios: a) First, we perform knowl-edge editing on only one instance d, which is as-sociated with up to four edited facts. b) Then,we split the dataset into groups of k instances(k ∈ {1, 100, 1000, 3000} on MQUAKE- CF andk ∈ {1, 100, 500, 1868} on MQUAKE- T), and con-sider all instances in a group at the same timeand inject all the edited facts of these instancesinto the model at once. This harder setting is par-ticularly interesting for editing methods such asMEMIT, which can handle large numbers of editseffectively (Meng et al., 2022b).3Throughout the paper, our experiments on MQUAKE-CF are conducted on a randomly sampled subset of the fulldataset which includes 3000 instances (1000 instances for eachof {2,3,4}-hop questions) due to limited compute resources.15689
[[PDF PAGE 5]]Base Model Method Edit-wise Instance-wise Multi-hop Multi-hop (CoT)GPT-JBase – 100.0 43.4 42.1FT 44.1 24.1 1.6 ↓41.8 1.9 ↓40.2MEND 72.8 59.6 9.2 ↓34.2 11.5 ↓30.6ROME 90.8 86.7 7.6 ↓35.8 18.1 ↓24.0MEMIT 97.4 94.0 8.1 ↓35.3 12.3 ↓29.8Vicuna-7BBase – 61.0 30.0 36.6FT 20.2 7.8 0.7 ↓29.3 0.2 ↓36.4MEND 65.2 47.6 7.4 ↓22.6 8.4 ↓28.2ROME 99.8 89.6 8.4 ↓21.6 12.2 ↓24.4MEMIT 96.6 84.0 7.6 ↓22.4 9.0 ↓27.6Table 3: Performance results on MQUAKE- CF (maximally 4 edits) for different knowledge editing methodsusing two base models, GPT-J and Vicuna-7B. We consider edits associated with each instance independently.Chain-of-thought (CoT) is included as a more advanced variant of prompt. Base denotes the model before editing.We include breakdown multi-hop (CoT) performance on MQUAKE- CF for {2,3,4}-hop questions and for questionswith {1,2,3,4} edits in Appendix G.3.4 Evaluation MetricsWe use the following metrics to measure whetherthe edits are made successfully. We include de-tailed formal definitions in Appendix B.• Edit-wise success rate measures how manyfacts can be successfully recalled from theedited language model.• Instance-wise accuracy measures in howmany multi-hop instances, the model can re-call all the individual single-hop facts. This isa reference metric for multi-hop performance,as the model must encode each individual factin order to answer the multi-hop question. Wemeasure instance-wise accuracy both beforeand after editing the model.• Multi-hop accuracy measures the accuracyof the original and edited language modelson multi-hop questions. In our datasets, thereare three generated multi-hop questions foreach instance. If any of the three questions iscorrectly answered by the model, we regard itas accurate. This is the main metric that wefocus on to study models’ ability to use editedknowledge consistently.4 MQ UAKE Challenges Model Editors4.1 Experimental SetupLanguage models We use GPT-J (6B) andVicuna-7B (Chiang et al., 2023), which is a fine-tuned model based on LLaMA-7B (Touvron et al.,2023) as the baseline models to evaluate knowl-edge editing approaches. It is worth noting thatexisting parameter-update methods require accessto a white-box language model and are very com-putationally expensive to apply to large models.In Section 5, we propose a lightweight approach,which can be applied to large black-box languagemodels (Ouyang et al., 2022; Brown et al., 2020).Knowledge editing approaches We evaluate thefollowing state-of-the-art knowledge editing ap-proaches on our datasets (more details can be foundin Appendix C).• Fine-tuning (FT) simply performs gradientdescent on the edits to update model parame-ters. We follow Zhu et al. (2021) and fine-tuneone layer in the model with a norm constrainton weight changes.• MEND (Mitchell et al., 2022a) trains a hyper-network to produce weight updates by trans-forming the raw fine-tuning gradients givenan edited fact.• ROME (Meng et al., 2022a) first localizesthe factual knowledge at a certain layer in theTransformer architecture, and then updates thefeedforward network in that layer to insert thenew facts.• MEMIT (Meng et al., 2022b) extends ROMEto edit a large set of facts. It updates feedfor-ward networks in a range of layers to encodeall the facts.Given an edited fact (s, r, o → o∗), we convert itto a cloze statement tr(s) and apply knowledgeediting approaches with the objective of correctlypredicting the edited object o∗ given tr(s). We15690
[[PDF PAGE 6]]Edit- Instance- Multi- Multi-hopMethod wise wise hop (CoT)Base – 100.0 34.3 46.8FT 19.5 19.0 0.0 ↓34.3 0.2 ↓46.6MEND 99.0 98.5 16.0 ↓18.3 38.2 ↓8.6ROME 100.0 97.7 0.3 ↓34.0 11.3 ↓35.5MEMIT 100.0 98.9 0.3 ↓34.0 4.8 ↓42.0Table 4: Performance results on MQUAKE- T for differ-ent knowledge editing methods using GPT-J as the basemodel.We consider edits associated with each instanceindependently. Base denotes the model before editing.include the templates of cloze statement tr for eachrelation type r in Appendix I.Evaluation metrics As discussed in Section 3.4,we report edit-wise success rate, instance-wise ac-curacy, and multi-hop accuracy in our evaluation.We query the model with either manually-writtenprompt templates (for single-hop facts) or GPT-generated questions (for multi-hop fact chains). Weadapt in-context learning and prompt the modelwith demonstrations when calculating instance-wise and multi-hop accuracy, in order to encouragethe language model to recall and output knowledgein the desirable format (Brown et al., 2020).We also consider chain-of-thought prompting(Wei et al., 2022) with in-context demonstrationsto ensure the model’s reasoning ability is fully uti-lized. See Appendix D for detailed prompts thatwe used to query language models. We denote themulti-hop accuracy with chain-of-thought prompt-ing as multi-hop (CoT).4.2 Results on MQ UAKE- CFTable 3 shows the results on MQUAKE- CF whenconsidering each instance individually across dif-ferent methods with GPT-J and Vicuna-7B as theediting base models. As shown, all of the editingmethods perform better than our fine-tuning base-line. In addition, they all gain traction on edit-wiseevaluation, with MEMIT and ROME achievinghigher than 90% accuracy with GPT-J and Vicuna-7B. In other words, when injecting a small numberof edits, these techniques successfully inject the ed-its into language models and have the edited modelrecall them at inference time, which corroboratesprevious findings (Zhu et al., 2021; De Cao et al.,2021; Meng et al., 2022a; Mitchell et al., 2022a,b).Subsequently, a low edit-wise success rate entailsa worse instance-wise accuracy (e.g., 59.6% forMEND vs. 94.0% for MEND), as instance-wisecorrectness relies on recalling every fact from themodel correctly for multi-hop questions.0 500 1000 1500 2000 2500 3000Number of Edited Instances010203040Multi-hop Acc. (%)FTMENDBaseMEMITROME(a) MQ UAKE- CF0 250 500 750 1000 1250 1500 1750Number of Edited Instances010203040Multi-hop Acc. (%)FTMENDBaseMEMITROME(b) MQ UAKE- TFigure 2: Multi-hop performance (CoT) of GPT-Jbefore and after editing on (a) MQUAKE- CF and(b) MQUAKE- T across four different knowledge-editing methods with k edited instances drawn for edit-ing. k ∈ {1, 100, 1000, 3000} on MQUAKE- CF. k ∈{1, 100, 500, 1868} on MQ UAKE- T.Surprisingly, the performance of edited modelsfails catastrophically at answering multi-hop ques-tions. Even with the strongest baseline approach,MEMIT, multi-hop performance changes from43.4% → 8.1% with GPT-J and 30.0% → 7.6%with Vicuna-7B. Our results lead to a surprisingconclusion that, although these methods act faith-fully when evaluating with single-hop questions,all of them fail catastrophically at answering multi-hop questions that rely on the edited facts. More im-portantly, compared to the ability to answer multi-hop questions prior to edits, model performancedrops significantly as well. Our findings suggestthat current knowledge-editing techniques, insteadof integrating new facts into the model as new inter-nal knowledge, are ratherhard coding them into themodel by updating weights locally. We hope theseresults can act as a call to the community to rethinkthe faithfulness of knowledge-editing methods and15691
[[PDF PAGE 7]]Tentative answerMulti-hop question What is the capital city of the country of citizenship of Ivanka Trump’s spouse? Subquestion Who is Ivanka Trump’s spouse?Tentative answer Ivanka Trump’s spouse is Jared KushnerRetrieved fact David Cameron is married to Courtney LoveAnswer Jared KushnerSubquestion What is the country of citizenship of Jared Kushner?The country of citizenship of Jared Kushner is United StatesJared Kushner is a citizen of CanadaCanada…… ……Final answer Ottawa Retrieved factAnswerDavid Cameron is married to Courtney LoveEdited Fact MemoryThe capital of the US is SeattleThe CEO of Apple is Carlos Slim…Our Approach: MeLLoQuery the memory with a subquestionRetrieve an edited fact from the memory Tentative answers generated by the model Retrieved facts Edited facts stored in the memoryJared Kushner is a citizen of Canada😐 not contradict⚠ contradict!Figure 3: The illustration of our proposed method MeLLo. MeLLo decompose a multi-hop question into subques-tions iteratively. When a subquestion is generated, the base model generates a tentative answer to the subquestion.Then, the subquestion is used to retrieve a most relevant fact from the edited fact memory. The model checks if theretrieved fact contradicts the generated answer and updates the prediction accordingly. The concrete prompts usedin MeLLo are shown in Appedix F.conduct deeper evaluations of edited models.One hypothesis that these edited models cannotanswer our multi-hop questions faithfully is thatour prompt is not effective enough. Recent workssuggest that providing explanations as Chain-of-thought (CoT) can greatly increase model perfor-mance even for models at the scale of 6B models(Wei et al., 2022). We further enhance our promptwith explanations and reevaluate all methods. De-tails about our CoT prompt template can be foundin Appendix D. As shown in Table 3, CoT helpsslightly across all settings yet still fails catastroph-ically at answering multi-hop questions. This fur-ther suggests that current knowledge-editing meth-ods fail to update knowledge faithfully.4.3 Results on MQ UAKE- TWe evaluate all methods on GPT-J with real-worldknowledge edit on MQUAKE .4 The evaluationresults are shown in Table 4. We find that inthis setting, all methods except fine-tuning achievenear-perfect performance in terms of edit-wise andinstance-wise accuracy. However, on multi-hopquestions, the performance drops significantly com-pared to the base model before editing. We findthat MEND works surprisingly well with CoT onMQUAKE- T. We hypothesize that this may bedue to MEND being particularly effective in edit-ing certain relations (e.g., head of state ). On the4We exclude Vicuna-7B on MQUAKE- T as it is trainedmore recently, and is likely to be contaminated with the newknowledge in our temporal questions.other hand, our results show that the edited modelwith CoT can substantially boost multi-hop perfor-mance. This suggests that explicit knowledge recallgreatly helps the edited models answer multi-hopquestions, while these models struggle to utilizethe edited knowledge internally.4.4 Evaluation with Edits at ScaleWe extend our evaluation and consider all the ed-its from a randomly split group of k instancesat the same time ( k ∈ {1, 100, 1000, 3000} onMQUAKE- CF and k ∈ {1, 100, 500, 1868} onMQUAKE- T). The results are shown in Fig-ure 2. We find that, on both MQUAKE- CF andMQUAKE- T, the multi-hop performance of allmethods further drops when injecting more editsinto language models at the same time.5 MeLLo: A Proposal for Editing LargeLanguage ModelsIn Section 4, our evaluation results show that ex-isting knowledge-editing methods fail catastroph-ically on multi-hop questions of MQUAKE . Inthis section, we present a simple but effective alter-native, MeLLo (Memory-based Editing for LargeLanguage Models).5.1 MethodFigure 3 illustrates how MeLLo answers multi-hopquestions. Inspired by memory-based knowledge-editing methods (Mitchell et al., 2022b), MeLLo15692
[[PDF PAGE 8]]keeps the base language model frozen and main-tains all the edits in an explicit memory. During in-ference, MeLLo (1) decomposes a multi-hop ques-tions into subquestions; (2) prompts the base lan-guage model to provide tentative answers to sub-questions; and (3) self-checks whether the tentativeanswers contradict any edited facts in the mem-ory. MeLLo can be applied easily to LLMs such asGPT-3 (Ouyang et al., 2022; Brown et al., 2020).Edited fact memory MeLLo stores all the editedfacts explicitly in memory. Specifically, all editedfacts are first converted into sentence statementsthrough manually-defined templates. Then, an off-the-shelf retrieval model (we use the pretrainedContriever model; Izacard et al. 2021) is used toembed all the edit statements and save them in aretrieval index. The index takes a query as inputand returns an edited fact that is the most relevant(i.e., closest in the embedding space) to the query.Step-by-step generation and self-checking Toanswer multi-hop questions with LLMs, we fol-low previous works and first prompt the model todecompose the multi-hop questions into multiplesimple subquestions (Press et al., 2022; Zhou et al.,2023a). For example, in Figure 3, the first subques-tion is Who is Ivanka Trump’s spouse? Second,the model generates a tentative answer (e.g., JaredKushner) to the subquestion based on the (unedited)knowledge stored in the model. Third, to assesswhether the generated answer conflicts with anynew knowledge edits, the subquestion is used as aquery to retrieve a most relevant editing statementfrom the edited facts saved in memory. Fourth,the model is prompted to self-check if the retrievedfact contradicts the generated answer. If it does, themodel adjusts the intermediate answer to this sub-question using the retrieved statement. Note that itis possible that a subquestion does not relate to anyedited fact in memory as the corresponding fact isnot edited; in this case, the model is prompted tokeep the generated answer as the retrieved edit doesnot cause a contradiction. Finally, the model eithergenerates the next subquestion of the multi-hopquestion or outputs the final answer.5.2 Evaluation ResultsWe apply MeLLo on GPT-J (Wang and Komat-suzaki, 2021), Vicuna-7B (Chiang et al., 2023),and text-davinci-003 (Ouyang et al., 2022;Brown et al., 2020). Table 5 shows performanceof MeLLo on MQUAKE- CF and MQUAKE- T.We find that with the same base model (i.e.,GPT-J), MeLLo outperforms MEMIT and MENDsignificantly across all the settings while be-ing more efficient and requiring no training.When incorporating MeLLo with a stronger LLM(text-davinci-003), MeLLo enlarges the perfor-mance gap substantially. This suggests that MeLLoworks particularly well on strong base languagemodels which can easily follow the instructions inour prompts. Along with its simplicity and efficacy,we think MeLLo can serve as a strong knowledge-editing baseline for future research. First, it doesnot require access to white-box model weights, soit is very extensible without any adaptation. Sec-ond, our base language model remains intact, avoid-ing the pitfall of overfitting to editing facts or de-stroying existing capacities due to weight updates.Third, we store edits in an explicit memory com-ponent instead of injecting facts into model pa-rameters, which provides greater controllability inremoving or adding knowledge on the fly.We note that in order to answer multi-hop ques-tions correctly after editing, the retriever we use inMeLLo needs to retrieve all the associated editedfacts from the memory. In Appendix H, we investi-gate how retrieval accuracy affects the performanceof MeLLo when using GPT-3 as the base model.6 Related WorkKnowledge-editing methods Past work has in-vestigated different approaches in editing LLMsat scale by injecting new knowledge into staticmodel artifacts (Zhu et al., 2021; Sotoudeh andThakur, 2019; Dai et al., 2022a; Hase et al., 2023;Zhou et al., 2023b; Dong et al., 2022; Huang et al.,2023). Some of these approaches include locatingand modifying model weights that are responsi-ble for specific concepts (Meng et al., 2022a,b;Dai et al., 2022b), and fast adaptation through asmall auxiliary editing network (Mitchell et al.,2022a; De Cao et al., 2021). Recent work editsknowledge representations during decoding pro-cedures of LLMs (Hernandez et al., 2023). Ourproposed approach MeLLo share a similar spiritwith SERAC (Mitchell et al., 2022b) where an ex-plicit memory component is used to maintain allthe edited facts. Different from SERAC, whichtrains additional models to incorporate the memory,MeLLo directly uses the base model to self-checkwhether the model generations need be adjusted.This allows MeLLo to be easily applied to black-15693
[[PDF PAGE 9]]MQUAKE- CF MQUAKE- T# Edited instances 1 100 1000 3000 1 100 500 1868Base Model MethodGPT-J MEMIT 12.3 9.8 8.1 1.8 4.8 1.0 0.2 0.0GPT-J MEND 11.5 9.1 4.3 3.5 38.2 17.4 12.7 4.6GPT-J MeLLo 20.3 12.5 10.4 9.8 85.9 45.7 33.8 30.7Vicuna-7B MeLLo 20.3 11.9 11.0 10.2 84.4 56.3 52.6 51.3GPT-3 MeLLo 68.7 50.5 43.6 41.2 91.1 87.4 86.2 85.5Table 5: Performance results of MeLLo (ours) on MQUAKE- CF and MQUAKE- T with GPT-J, Vicuna-7B,or GPT-3 (text-davinci-003) as the base language model. We consider a batch of k instances as once ( k ∈{1, 100, 1000, 3000} on MQUAKE- CF and k ∈ {1, 100, 500, 1868} on MQUAKE- T). We include the best resultswith GPT-J from existing methods (MEMIT for MQUAKE- CF and MEND for MQ UAKE- T) for comparison.box LMs without any extra training.Knowledge-editing evaluation The evaluationmetrics for knowledge-editing techniques often in-volve verifying the updated answers by queryingthe edited facts or related facts (paraphrased orlogically-entailed facts), as well as verifying that ir-relevant facts are not corrupted (Meng et al., 2022a;Mitchell et al., 2022a; De Cao et al., 2021; Zhuet al., 2021; Hase et al., 2023). More recent worktakes a step forward by evaluating LLMs’ abilitiesto make inferences based on injected facts (Onoeet al., 2023) (e.g., after learning iPhone is a smart-phone, the model should also know iPhone canbrowse the internet), or measuring the absence ofunintended side effects of model edits (Hoelscher-Obermaier et al., 2023). Complementary withexisting evaluation tools, MQUAKE particularlyfocuses on assessing whether edited models can an-swer multi-hop questions where the answer shouldchange as an entailed consequence, showing thatexisting approaches fail on those questions.Prompting methods for multi-hop QA Sincethe debut of effective base models such as GPT-3,prompt-based methods combined with an optionalretrieval module have become a popular approachin handling multi-step QA tasks (Press et al., 2022;Yao et al., 2023; Khattab et al., 2022). Recentwork also seeks to combine external NLI mod-ules to justify whether answers to prompt-basedqueries are able to handle reasoning-based QAquestions (Mitchell et al., 2022c). Our method issimilar but more generic since we rely on the LLMitself to perform NLI step-by-step before reachingthe final answer.7 ConclusionIn this work, we present a benchmark MQUAKEthat assesses knowledge editing methods for lan-guage models via multi-hop questions. We findthat although edited language models can effec-tively recall edited facts, they fail on multi-hopquestions that are entailed consequences of the ed-its. We propose a simple but effective alternative,MeLLo, which significantly outperforms existingknowledge editing methods. MeLLo does not re-quire any additional training and can be appliedto large LMs such as GPT-3 (Brown et al., 2020).We hope our work can facilitate future research ondeveloping faithful knowledge editing methods.LimitationsThe limitations of our work are as follows.• We mainly evaluate existing knowledge edit-ing methods on GPT-J (Wang and Komat-suzaki, 2021) and Vicuna (Chiang et al., 2023).The efficacy of these methods on other LLMsremains less explored. Note that existing edit-ing methods are very computationally expen-sive. We leave the evaluation on other modelsas future work.• We demonstrate that MeLLo outperforms ex-isting knowledge editing methods on modelswith > 6B parameters. As MeLLo relies onlanguage models for question decompositionand self-checking, future work may study howMeLLo works with smaller models such asGPT-2 (Radford et al., 2019).• Our proposed memory-based approach,MeLLo, while being very effective on theMQUAKE benchmark, requires manually15694
[[PDF PAGE 10]]defined prompts to drive language modelson new tasks. Although we believe MeLLois easy to instantiate on different tasks, weacknowledge this limitation and leave theevaluation on other tasks as future work.• The multi-hop questions in MQUAKE areautomatically generated by ChatGPT, ratherthan being crafted by humans. AlthoughMQUAKE- T already involves real knowl-edge changes, we posit that the use ofhuman-authored questions could further alignMQUAKE with the realistic applications ofknowledge editing methods.AcknowledgementsWe thank Dan Friedman, Tianyu Gao, EricMitchell, Mengzhou Xia, Howard Yen, Jiayi Gengfor providing valuable feedback. This research ispartially supported by an NSF CAREER award(IIS-2239290), a Sloan Research Fellowship, andMicrosoft Azure credits through the “AccelerateFoundation Models Academic Research” Initiative.ZZ is supported by a JP Morgan Ph.D. Fellowship.CM is a CIFAR Fellow.ReferencesTom Brown, Benjamin Mann, Nick Ryder, MelanieSubbiah, Jared D Kaplan, Prafulla Dhariwal, ArvindNeelakantan, Pranav Shyam, Girish Sastry, AmandaAskell, et al. 2020. Language models are few-shotlearners. In Advances in Neural Information Process-ing Systems (NeurIPS).Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng,Zhanghao Wu, Hao Zhang, Lianmin Zheng, SiyuanZhuang, Yonghao Zhuang, Joseph E. Gonzalez, IonStoica, and Eric P. Xing. 2023. Vicuna: An open-source chatbot impressing GPT-4 with 90%* Chat-GPT quality.Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, BaobaoChang, and Furu Wei. 2022a. Knowledge neurons inpretrained transformers. In Association for Computa-tional Linguistics (ACL).Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, BaobaoChang, and Furu Wei. 2022b. Knowledge neurons inpretrained transformers. In Association for Computa-tional Linguistics (ACL).Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021.Editing factual knowledge in language models. InEmpirical Methods in Natural Language Processing(EMNLP).Qingxiu Dong, Damai Dai, Yifan Song, Jingjing Xu,Zhifang Sui, and Lei Li. 2022. Calibrating factualknowledge in pretrained language models. In Find-ings of Empirical Methods in Natural Language Pro-cessing (EMNLP).Peter Hase, Mona Diab, Asli Celikyilmaz, Xian Li, Zor-nitsa Kozareva, Veselin Stoyanov, Mohit Bansal, andSrinivasan Iyer. 2023. Do language models havebeliefs? Methods for detecting, updating, and visu-alizing model beliefs. In European Chapter of theAssociation for Computational Linguistics (EACL) .Evan Hernandez, Belinda Z Li, and Jacob Andreas.2023. Measuring and manipulating knowledge rep-resentations in language models. arXiv preprintarXiv:2304.00740.Jason Hoelscher-Obermaier, Julia Persson, Esben Kran,Ioannis Konstas, and Fazl Barez. 2023. Detect-ing edit failures in large language models: Animproved specificity benchmark. arXiv preprintarXiv:2305.17553.Zeyu Huang, Yikang Shen, Xiaofeng Zhang, Jie Zhou,Wenge Rong, and Zhang Xiong. 2023. Transformer-patcher: One mistake worth one neuron. In Inter-national Conference on Learning Representations(ICLR).Gautier Izacard, Mathilde Caron, Lucas Hosseini, Se-bastian Riedel, Piotr Bojanowski, Armand Joulin,and Edouard Grave. 2021. Towards unsuperviseddense information retrieval with contrastive learn-ing. Transactions on Machine Learning Research(TMLR).Zhengbao Jiang, Frank F Xu, Jun Araki, and GrahamNeubig. 2020. How can we know what languagemodels know? In Transactions of the Association ofComputational Linguistics (TACL).Omar Khattab, Keshav Santhanam, Xiang LisaLi, David Hall, Percy Liang, Christopher Potts,and Matei Zaharia. 2022. Demonstrate-search-predict: Composing retrieval and language mod-els for knowledge-intensive NLP. arXiv preprintarXiv:2212.14024.Alex Mallen, Akari Asai, Victor Zhong, Rajarshi Das,Hannaneh Hajishirzi, and Daniel Khashabi. 2023.When not to trust language models: Investigatingeffectiveness and limitations of parametric and non-parametric memories. In Association for Computa-tional Linguistics (ACL).Kevin Meng, David Bau, Alex Andonian, and YonatanBelinkov. 2022a. Locating and editing factual asso-ciations in GPT. In Advances in Neural InformationProcessing Systems (NeurIPS).Kevin Meng, Arnab Sen Sharma, Alex Andonian,Yonatan Belinkov, and David Bau. 2022b. Mass-editing memory in a transformer. In InternationalConference on Learning Representations (ICLR) .15695
[[PDF PAGE 11]]Eric Mitchell, Charles Lin, Antoine Bosselut, ChelseaFinn, and Christopher D Manning. 2022a. Fast modelediting at scale. In International Conference onLearning Representations (ICLR).Eric Mitchell, Charles Lin, Antoine Bosselut, Christo-pher D Manning, and Chelsea Finn. 2022b. Memory-based model editing at scale. In International Con-ference on Machine Learning (ICML) .Eric Mitchell, Joseph J. Noh, Siyan Li, William S. Arm-strong, Ananth Agarwal, Patrick Liu, Chelsea Finn,and Christopher D. Manning. 2022c. Enhancing self-consistency and performance of pretrained languagemodels with NLI. In Empirical Methods in NaturalLanguage Processing (EMNLP).Yasumasa Onoe, Michael JQ Zhang, Shankar Padman-abhan, Greg Durrett, and Eunsol Choi. 2023. Canlms learn new entities from descriptions? Challengesin propagating injected knowledge. In Associationfor Computational Linguistics (ACL).Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Car-roll L. Wainwright, Pamela Mishkin, Chong Zhang,Sandhini Agarwal, Katarina Slama, Alex Ray, JohnSchulman, Jacob Hilton, Fraser Kelton, Luke E.Miller, Maddie Simens, Amanda Askell, Peter Welin-der, Paul Francis Christiano, Jan Leike, and Ryan J.Lowe. 2022. Training language models to followinstructions with human feedback. In Advances inNeural Information Processing Systems (NeurIPS) .Fabio Petroni, Tim Rocktäschel, Patrick Lewis, An-ton Bakhtin, Yuxiang Wu, Alexander H Miller, andSebastian Riedel. 2019. Language models as knowl-edge bases? In Empirical Methods in Natural Lan-guage Processing (EMNLP).Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt,Noah A Smith, and Mike Lewis. 2022. Measuringand narrowing the compositionality gap in languagemodels. arXiv preprint arXiv:2210.03350.Alec Radford, Jeffrey Wu, Rewon Child, David Luan,Dario Amodei, Ilya Sutskever, et al. 2019. Languagemodels are unsupervised multitask learners. OpenAIblog.Taylor Shin, Yasaman Razeghi, Robert L Logan IV ,Eric Wallace, and Sameer Singh. 2020. Autoprompt:Eliciting knowledge from language models with auto-matically generated prompts. In Empirical Methodsin Natural Language Processing (EMNLP) , pages4222–4235.Anton Sinitsin, Vsevolod Plokhotnyuk, Dmitry Pyrkin,Sergei Popov, and Artem Babenko. 2020. Editableneural networks. In International Conference onMachine Learning (ICML).Matthew Sotoudeh and Aditya V Thakur. 2019. Cor-recting deep neural networks with small, generalizingpatches. In Workshop on Safety and Robustness inDecision Making.Hugo Touvron, Thibaut Lavril, Gautier Izacard, XavierMartinet, Marie-Anne Lachaux, Timothée Lacroix,Baptiste Rozière, Naman Goyal, Eric Hambro,Faisal Azhar, et al. 2023. LLaMA: Open and ef-ficient foundation language models. arXiv preprintarXiv:2302.13971.Denny Vrandeˇci´c and Markus Krötzsch. 2014. Wiki-data: a free collaborative knowledgebase. Communi-cations of the ACM, 57(10):78–85.Ben Wang and Aran Komatsuzaki. 2021. GPT-J-6B: A 6 Billion Parameter Autoregressive Lan-guage Model. https://github.com/kingoflolz/mesh-transformer-jax.Jason Wei, Xuezhi Wang, Dale Schuurmans, MaartenBosma, Ed Chi, Quoc Le, and Denny Zhou. 2022.Chain of thought prompting elicits reasoning in largelanguage models. In Advances in Neural InformationProcessing Systems (NeurIPS).Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, IzhakShafran, Karthik Narasimhan, and Yuan Cao. 2023.ReAct: Synergizing reasoning and acting in languagemodels. In International Conference on LearningRepresentations (ICLR).Zexuan Zhong, Dan Friedman, and Danqi Chen. 2021.Factual probing is [MASK]: Learning vs. learning torecall. In North American Chapter of the Associationfor Computational Linguistics (NAACL).Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei,Nathan Scales, Xuezhi Wang, Dale Schuurmans,Olivier Bousquet, Quoc Le, and Ed Chi. 2023a.Least-to-most prompting enables complex reasoningin large language models. In International Confer-ence on Learning Representations (ICLR) .Wenxuan Zhou, Sheng Zhang, Hoifung Poon, andMuhao Chen. 2023b. Context-faithful prompt-ing for large language models. arXiv preprintarXiv:2303.11315.Chen Zhu, Ankit Singh Rawat, Manzil Zaheer, SrinadhBhojanapalli, Daliang Li, Felix Yu, and Sanjiv Kumar.2021. Modifying memories in transformer models.In International Conference on Machine Learning(ICML).15696
[[PDF PAGE 12]]A Details of Dataset ConstructionA.1 Sampling Fact Chains from WikidataWe collect chains of facts that containN = {2, 3, 4}triples from Wikidata. We adopt heuristic rules toensure that the sampled fact triples are coherentand lead to natural questions. Specifically, we ap-ply the following constraints when sampling factchains from Wikidata. (1) The sampled chain doesnot involve a circle; (2) The sampled chain doesnot contain two triples that share the same relationtype; (3) The triples with the object being a countrycan only appear in the last two hops of the chain;(4) The sampled chain contains up to three objecttypes; (5) All triples with a person or location ob-ject are consecutive in the chain; (6) The subjectentity associated with the relation headquarterslocation (P159) must be a company or an organi-zation; (7) In all triples with the relation capital(P36), the subject has to be a country. To use theseheuristic rules, we manually label the object typesfor each relation we consider. For example, therelation head of state (P35) corresponds to a personas the object.A.2 Filtering Unrecallable Facts with GPT-JWe filter out any chain of facts which contain atleast one fact that cannot be recalled by GPT-J. Foreach relation type, we manually define a questiontemplate as well as 8 demonstration examples forin-context-learning. We use in-context-learning toensure the model can capture the answer formatfrom the context. Table 6 shows an example of theprompt we use to recall facts of the relation devel-oper (P178). We include the question templates ofall relations on MQ UAKE in Appendix I.A.3 Generating Questions using ChatGPTGiven a chain of facts, we prompt ChatGPT(gpt-3.5-turbo) to automatically generate multi-hop questions. The prompt we used is shown inTable 7.In Table 8, we show some randomly selectedexamples of the questions generated by ChatGPTon MQUAKE- CF. We select 3 instances from2, 3, 4−hop questions, each of which contains threegenerated questions. As shown, ChatGPT success-fully transforms the chain of triples into grammati-cally correct questions. Although these multi-hopquestions are synthetic, they are logically consis-tent with the flow of the triple chains. We believethese generated questions are of sufficient qual-ity for assessing the efficacy of knowledge-editingmethods.B Evaluation MetricsWe evaluate the editing results based on three evalu-ation metrics: edit-wise success rate, instance-wiseaccuracy, and multi-hop accuracy. Suppose wehave edited a language model and obtain the editedmodel f∗(⋅).Edit-wise success rate measures how manyedited facts can be recalled by the edited languagemodel. Given an edit e= (s, r, o → o∗), the editingsuccess is defined as 1 [f∗(tr(s))= o∗]. We takethe averaged value of the all edits in the dataset andrefer it as the edit-wise success rate metric.Instance-wise accuracy measures how many in-stances are there where all the associated factscan be recalled by the language model (eitherthe original or edited one). Given an instanced= ⟨E, Q, a, a∗, C, C∗⟩, the instance-wise accuracybefore editing is defined as1⎡⎢⎢⎢⎢⎣⋀(s,r,o)∈C[f(tr(s))= o]⎤⎥⎥⎥⎥⎦,and the instance-wise accuracy post editing is de-fined as1⎡⎢⎢⎢⎢⎣⋀(s,r,o)∈C∗[f∗(tr(s))= o∗]⎤⎥⎥⎥⎥⎦.We report the averaged instance-wise accuracy inour evaluation.Multi-hop accuracy measures the accuracy onmulti-hop questions. We regard an instance be-ing predicted correctly if any of the multi-hopquestions are answered correctly by the languagemodel. Given an instance d = ⟨E, Q, a, a∗, C, C∗⟩,the multi-hop accuracy before editing is defined as1⎡⎢⎢⎢⎣⋁q∈Q[f(q)= a]⎤⎥⎥⎥⎦,and the multi-hop accuracy post editing is definedas1⎡⎢⎢⎢⎣⋁q∈Q[f∗(q)= a∗]⎤⎥⎥⎥⎦.We report the averaged multi-hop accuracy in ourevaluation.15697
[[PDF PAGE 13]](In-context-learning examples)Q: Who is the developer of Telegram? A: Telegram FZ-LLCQ: Who is the developer of Microsoft Windows? A: MicrosoftQ: Who is the developer of PlayStation 2? A: Sony Interactive EntertainmentQ: Who is the developer of iTunes? A: Apple Inc.Q: Who is the developer of SR-71 Blackbird? A: Kelly JohnsonQ: Who is the developer of Moblin? A: Linux FoundationQ: Who is the developer of Xbox 360? A: MicrosoftQ: Who is the developer of Kinsey scale? A: Alfred Kinsey(Query during inference)Q: Who is the developer of SteamOS? A: Valve CorporationTable 6: An example of the prompt we used to recall single-hop factf with relation developer (P178) from languagemodels. We use in-context-learning with 8 demonstration examples to ensure the model can output the answer in adesirable format.System:You are a powerful multi-hop question generator. Users will provide a chain of Wikidata triples,and you will help write questions to ask the tail entity from the head entity. You shouldn’tinclude bridge entities in generated questions. The questions should only include the head entity.[12 in-context demonstrations abbreviated ]User:Given Wikidata triples (Daredevil/Bullseye: The Target, author, x1), (x1, country of citizenship,x2), (x2, continent, x3), write a question to ask x3. Don’t mention x1, x2, ... Write threepossible questions in natural English.System:1. What continent is the country of citizenship of the author of Daredevil/Bullseye: The Targetlocated in?2. From which continent does the author of Daredevil/Bullseye: The Target’s country of citizenshipbelong?3. What continent is the author’s country of citizenship, who wrote Daredevil/Bullseye: The Target,situated in?Table 7: An example of using ChatGPT (gpt-3.5-turbo) to generate questions from Wikidata triples. We manuallywrite 12 demonstrations as the prompt when querying ChatGPT.C Implementation Details for KnowledgeEditing MethodsC.1 Fine-tuningOur fine-tuning baseline (FT) performs gradientdescent on the edits to update model parameters.We fine-tune layer 21 of GPT-J and layer 31 ofVicuna-7B. We follow Zhu et al. (2021) and use anorm constraint on weight changes with a coeffi-cient 5 × 10−5 in our implementation.C.2 MENDWe use the GPT-J MEND editor trained by Menget al. (2022a). For Vicuna-7B, we train our ownMEND editor model on the Wikitext generationediting dataset (Mitchell et al., 2022a) with thedifferent hyperparameters. During inference, weset the learning rate scale to be 1.0.C.3 ROMEFor GPT-J, we use the default hyperparameters ofROME and the pre-computed covariance statisticsreleased by Meng et al. (2022a). For Vicuna-7B,we run ROME to update model weights at layer9 with the default hyperparameters. We computethe covariance statistics for Vicuna-7B on Wikitextusing a sample size of 100,000.C.4 MEMITFor GPT-J, we use the default hyperparameters ofMEMIT and the pre-computed covariance statisticsreleased by Meng et al. (2022b). For Vicuana-7B,we update model weights at layers {5, 6, 7, 8, 9}with the default hyperparameters. Similarly, wecompute the covariance statistics for Vicuna-7B onWikitext using a sample size of 100,000.15698
[[PDF PAGE 14]]Examples of 2-hop questionsC (Jacques Necker, employer, University of Geneva) (University of Geneva, headquarters location, Geneva)Q What is the location of the headquarters of the employer of Jacques Necker?Where is the employer of Jacques Necker headquartered?In which city is the head office located for the company that employed Jacques Necker?C (Percival Lowell, educated at, Harvard University) (Harvard University, headquarters location, Cambridge)Q What is the location of the headquarters of the institution where Percival Lowell was educated?In which city is the institution located where Percival Lowell received his education?Where is the headquarters of the educational institution attended by Percival Lowell located?C (Gordon Moore, country of citizenship, United States of America) (United States of America, capital, Washington, D.C.)Q What is the capital of the country where Gordon Moore holds citizenship?Which is the capital city of the country to which Gordon Moore belongs?In which city is the seat of the government of the country where Gordon Moore is a citizen?Examples of 3-hop questionsC (Kim Kardashian, spouse, Kanye West) (Kanye West, genre, hip hop music)(hip hop music, country of origin, United States of America)Q What is the country of origin of the genre associated with the spouse of Kim Kardashian?From which country does the genre of the partner of Kim Kardashian hail?Which country is the genre of the partner of Kim Kardashian associated with originally from?C (Nicholas of Tolentino, religion or worldview, Catholic Church) (Catholic Church, founded by, Jesus Christ)(Jesus Christ, place of birth, Bethlehem)Q Where was the founder of Nicholas of Tolentino’s religion born?In which city was the founder of the religion that Nicholas of Tolentino adhered to born?What is the birthplace of the founder of the religion that Nicholas of Tolentino followed?C (Boston, head of government, Marty Walsh) (Marty Walsh, educated at, Boston College)(Boston College, headquarters location, Chestnut Hill)Q In what city is the headquarters of the institution where the head of government of Boston was educated located?Where is the location of the headquarters of the educational institution where the head of government of Bostonreceived their education?What is the city where the headquarters of the institution where the head of government of Boston was educatedat located?Examples of 4-hop questionsC (Xbox Live, developer, Microsoft) (Microsoft, chief executive officer, Satya Nadella)(Satya Nadella, place of birth, Hyderabad) (Hyderabad, continent, Asia)Q Which continent is home to the birthplace of the CEO of Xbox Live developer?Where was the CEO of the developer of Xbox Live born in which continent?In what continent was the CEO of Xbox Live’s developer born?C (Winnie the Pooh, creator, A. A. Milne) (A. A. Milne, child, Christopher Robin Milne)(Christopher Robin Milne, country of citizenship, United Kingdom) (United Kingdom, official language, English)Q What is the official language of the country where the child of Winnie the Pooh’s creator holds citizenship?Which language is officially spoken in the country where the child of the creator of Winnie the Pooh is a citizen?What is the officiated language of the country where the child of Winnie the Pooh’s creator is a citizen of?C (watchOS, developer, Apple Inc.) (Apple Inc., chief executive officer, Tim Cook)(Tim Cook, country of citizenship, United States of America) (United States of America, capital, Washington, D.C.)Q What is the capital of the country where the CEO of the developer of watchOS holds citizenship?In which city does the CEO of the company that developed watchOS hold citizenship?Which city is the capital of the home country of the CEO of the developer of watchOS?Table 8: Qualitative examples of the generated multi-hop questions on MQUAKE- CF. Given a chain of facts, wequery ChatGPT (gpt-3.5-turbo) to generate multi-hop questions with the prompt shown in Table 7.D Chain-of-thought Prompting forMulti-hop QuestionsWe use chain-of-thought (CoT) prompting (Weiet al., 2022) to maximize model performance. Ta-ble 9 shows one simplified example of our promptwith CoT.E Extended Golden Labels forMQUAKE- TOur MQUAKE- T contains limited test cases. Tobetter assess the model’s original performance onmulti-hop questions, we extend the possible goldenlabels for each multi-hop question. Specifically,we allow outdated answers given smaller language15699
[[PDF PAGE 15]]Question: What is the capital of the country where Plainfield Town Hall is located?Thoughts: Plainfield Town Hall is located in the country of the United States of America. Thecapital of United States is Washington, D.C.Answer: Washington, D.C.Question: In which country is the company that created Nissan 200SX located?Thoughts: Nissan 200SX was created by Nissan. Nissan is located in the country of Japan.Answer: Japan[3 in-context demonstrations abbreviated ]Question: Who has ownership of the developer of the Chevrolet Corvette (C4)?Thoughts: The developer of Chevrolet Corvette (C4) is Chevrolet. Chevrolet is owned by GeneralMotors.Answer: Model Generated Answer Goes HereTable 9: The template of the prompt we used for asking multi-hop questions using chain-of-thoughts.Please answer the following question faithfully using the knowledge you have from Wikipedia.Provide 10 possible answers to the question, using all the Wikipedia data you know. Rank them fromthe most current to the most outdated.Input: What is the name of the current head of the United States of America government?Output:Joe BidenDonald TrumpBarack ObamaGeorge W. BushBill ClintonGeorge H. W. BushRonald ReaganJimmy CarterGerald FordRichard NixonInput: What is the name of the current head of the New York City government?Output: Model Generated Answer Goes HereTable 10: The template of the prompt we used for extending golden labels for MQUAKE- T. The prompt containsone demonstration for better aligning model behaviors.models tend to be less calibrated. To extend thegolden labels, we use GPT-3 (text-davinci-003)to query outdated answers. See the prompt we usedin Table 10.F Prompts used in MeLLoThe prompt we used in MeLLo is shown in Ta-ble 11. We first prompt the language model to de-compose subquestions. Then the language modelgenerates a tentative question to the subquestion(marked in green text); then we use the generatedsubquestion to retrieve the most relevant edited fact(marked in light blue text) and append it to theprompt. The model self-checks if the retrieved factcontradicts the generated answer. The promptingprocedure goes iteratively until the model generatesthe final answer.G Breakdown Results on MQ UAKE- CFTable 12 and Table 13 present the breakdown re-sults on MQUAKE- CF when using GPT-J as thebase model. We find that, in all editing methods(1) the performance on 2-hop questions is muchhigher than 3-hop and 4-hop questions; (2) theperformance is worse when there are more editsasssociated with the edited instances.H Impact of Retrieval PerformanceIn MeLLo, in order to answer multi-hop questionscorrectly after editing, the retrieval model needs toretrieve all the associated edited facts (each ques-tion is associated with 1-4 edited facts) from thememory. Here we investigate how retrieval accu-racy affects the performance of MeLLo when usingGPT-3 as the base model. We compute the retrievalaccuracy (i.e., how many instances where all the as-15700
[[PDF PAGE 16]][4 in-context demonstrations abbreviated ]Question: What is the capital city of the country of citizenship of Ivanka Trump’s spouse?Subquestion: Who is Ivanka Trump’s spouse?Generated answer: Ivanka Trump’s spouse is Jared Kushner.Retrieved fact: David Cameron is married to Samantha Cameron.Retrieved fact does not contradict to generated answer, so the intermediate answer is: JaredKushnerSubquestion: What is the country of citizenship of Jared Kushner?Generated answer: The country of citizenship of Jared Kushner is United States.Retrieved fact: Jared Kushner is a citizen of Canada.Retrieved fact contradicts to generated answer, so the intermediate answer is: CanadaSubquestion: What is the capital city of Canada?Generated answer: The capital city of Canada is Ottawa.Retrieved fact: The capital city of United States is Seattle.Retrieved fact does not contradict to generated answer, so the intermediate answer is: OttawaFinal answer: OttawaTable 11: A step-by-step illustration of MeLLo solving one simplified example. Green parts are generated by thelanguage model, and blue parts are facts retrieved by the retriever.2-hop 3-hop 4-hop AllBase 47.5 27.1 45.3 42.1FT 3.7 1.4 0.5 1.9MEND 13.9 11.3 9.5 11.5ROME 33.8 9.1 11.4 18.1MEMIT 22.5 6.0 8.4 12.3Table 12: Breakdown multi-hop performance (CoT) onMQUAKE- CF for {2,3,4}-hop questions. We use GPT-J as the base model in this experiment# Edits = 1 2 3 4 AllBase 34.0 43.0 40.4 51.7 42.1FT 4.2 0.7 0.3 0.0 1.9MEND 16.0 11.0 7.3 4.4 11.5ROME 23.8 20.9 9.0 2.6 18.1MEMIT 20.5 9.8 5.5 2.6 12.3Table 13: Breakdown multi-hop performance (CoT) onMQUAKE- CF for questions with {1,2,3,4} edits. Weuse GPT-J as the base model in this experiment.# Instances (k =) 1 100 1000 3000Retrieval acc. 93.6 67.7 59.4 58.7MeLLo (on GPT-3) 68.7 50.5 43.6 41.2Table 14: How retrieval accuracy affects the multi-hopperformance of MeLLo on MQUAKE- CF. We considera group of k instances at the same time. Retrieval acc.:how many instances where all the associated edited factsare correctly retrieved from the memory.sociated edited facts are correctly retrieved from thememory) when applying MeLLo on MQUAKE-CF with GPT-3 by considering different numbersof edited instances at the same time. As Table 14shows, the performance of MeLLo decreases if theretrieval accuracy is lower (as a result of consider-ing more instances at the same time). Among thosequestions where all associated facts are success-fully retrieved from memory, MeLLo can answer73.1% of them correctly. This indicates that re-trieval performance can significantly impact themodel performance. When we consider more ir-relevant knowledge edits in the memory, retrievalcan be more challenging, and we expect that usingmore advanced retrieval techniques can improvethe performance.I Question/Cloze Statement Templatesused in MQ UAKETable 15 shows the question templates andthe cloze-style statement templates we use inMQUAKE. We use the question templates to querysingle-hop facts when we use GPT-J for filteringand use the cloze-style statement templates to con-vert an edited fact to a natural language statement.15701
[[PDF PAGE 17]]Relation Question template Cloze-style statement templateP30 Which continent is [S] located in? [S] is located in the continent ofP36 What is the capital of [S]? The capital of [S] isP35 What is the name of the current head of state in [S]? The name of the current head of state in [S] isP6 What is the name of the current head of the [S] government? The name of the current head of the [S] government isP20 Which city did [S] die in? [S] died in the city ofP26 Who is [S] married to? [S] is married toP140 Which religion is [S] affiliated with? [S] is affiliated with the religion ofP1412 What language does [S] speak? [S] speaks the language ofP19 Which city was [S] born in? [S] was born in the city ofP69 Which university was [S] educated at? The univeristy where [S] was educated isP40 Who is [S]’s child? [S]’s child isP27 What is the country of citizenship of [S]? [S] is a citizen ofP175 Who performed [S]? [S] was performed byP108 Who is the employer of [S]? [S] is employed byP112 Who founded [S]? [S] was founded byP50 Who is the author of [S]? The author of [S] isP170 Who was [S] created by? [S] was created byP407 Which language was [S] written in? [S] was written in the language ofP37 What is the official language of [S]? The official language of [S] isP740 Where was [S] founded? [S] was founded in the city ofP495 Which country was [S] created in? [S] was created in the country ofP106 What kind of work does [S] do? [S] works in the field ofP136 What type of music does [S] play? The type of music that [S] plays isP364 What is the original language of [S]? The original language of [S] isP937 Which city did [S] work in? [S] worked in the city ofP800 What is [S] famous for? [S] is famous forP641 Which sport is [S] associated with? [S] is associated with the sport ofP413 What position does [S] play? [S] plays the position ofP286 Who is the head coach of [S]? The head coach of [S] isP159 Which city is the headquarter of [S] located in? The headquarters of [S] is located in the city ofP178 Who is the developer of [S]? [S] was developed byP488 Who is the chairperson of [S]? The chairperson of [S] isP169 Who is the chief executive officer of [S]? The chief executive officer of [S] isP449 Who is the original broadcaster of [S]? The origianl broadcaster of [S] isP176 Which company is [S] produced by? The company that produced [S] isP1037 Who is the director of [S]? The director of [S] isP1308 Who is the [S]? The [S] isTable 15: Question templates and cloze-style statement templates that are used in MQUAKE . “[S]” represents aplaceholder for the subject entity of the fact. We use the question templates to query single-hop facts when we useGPT-J for filtering and use the cloze-style statement templates to convert an edited fact to a statement.15702123version https://git-lfs.github.com/spec/v1oid sha256:553faaccf0cfc8ce7be6a4171c3a8b33d8c512ab1346a9b5017d2e020d24480dsize 10528164123version https://git-lfs.github.com/spec/v1oid sha256:f4489c3a6fd6144c1d5d4961280ce40179401436891bded4cc7406ceb07761c6size 1965159.gitattributes+22
results/knowledge-change-v1/tracking-wandb/w730011-shared_full-changed_atomic/state.jsonAdded+10
results/knowledge-change-v1/tracking-wandb/w730011-shared_full-changed_use/state.jsonAdded+10
results/knowledge-change-v1/tracking-wandb/w730011-shared_full-fixed/state.jsonAdded+10
results/knowledge-change-v1/tracking.logAdded
results/knowledge-change-v1/verification.jsonAdded+35
results/learning-use-20261007/completion-manifest.jsonAdded+363
results/learning-use-cloud-audit-20261007/audit-sequential-confirmation.logAdded+33
results/learning-use-cloud-audit-20261007/audit-sequential-confirmation.pyAdded+151
results/learning-use-cloud-audit-20261007/audit.logAdded+34
results/learning-use-cloud-audit-20261007/audit.pyAdded+135
results/learning-use-runtime-20261007/gpu0.jsonAdded+33
results/learning-use-runtime-20261007/gpu1.jsonAdded+33
results/learning-use-runtime-20261007/gpu2.jsonAdded+33
results/learning-use-runtime-20261007/gpu3.jsonAdded+33
results/learning-use-runtime-20261007/gpu4.jsonAdded+33
results/learning-use-runtime-20261007/gpu5.jsonAdded+33
results/learning-use-runtime-20261007/gpu6.jsonAdded+33
results/learning-use-runtime-20261007/gpu7.jsonAdded+33
results/learning-use-runtime-20261007/summary.jsonAdded+46
results/literature-framing-review-20261007/coconut2025.pdfAdded+3
results/literature-framing-review-20261007/coconut2025.txtAdded+749
results/literature-framing-review-20261007/composition-collapse2026.pdfAdded+3
results/literature-framing-review-20261007/composition-collapse2026.txtAdded+2137
results/literature-framing-review-20261007/composition2024.pdfAdded+3
results/literature-framing-review-20261007/composition2024.txtAdded
results/literature-framing-review-20261007/factual2025.pdfAdded+3
results/literature-framing-review-20261007/factual2025.txtAdded
results/literature-framing-review-20261007/grokking2024.pdfAdded+3
results/literature-framing-review-20261007/grokking2024.txtAdded+1714
results/literature-framing-review-20261007/hebbian2026.pdfAdded+3
results/literature-framing-review-20261007/hebbian2026.txtAdded
results/literature-framing-review-20261007/hopping-late2024.pdfAdded+3
results/literature-framing-review-20261007/hopping-late2024.txtAdded+1828
results/literature-framing-review-20261007/implicit2025.pdfAdded+3
results/literature-framing-review-20261007/implicit2025.txtAdded
results/literature-framing-review-20261007/latent-multihop2024.pdfAdded+3
results/literature-framing-review-20261007/latent-multihop2024.txtAdded
results/literature-framing-review-20261007/literature-notes.jsonAdded+314
results/literature-framing-review-20261007/loop-horizon2026.pdfAdded+3
results/literature-framing-review-20261007/loop-horizon2026.txtAdded
results/literature-framing-review-20261007/loop2025.pdfAdded+3
results/literature-framing-review-20261007/loop2025.txtAdded
results/literature-framing-review-20261007/mobius2026.pdfAdded+3
results/literature-framing-review-20261007/mobius2026.txtAdded+1082
results/literature-framing-review-20261007/mquake2023.pdfAdded+3
results/literature-framing-review-20261007/mquake2023.txtAdded+1515
results/literature-framing-review-20261007/ouro2026.pdfAdded+3
results/literature-framing-review-20261007/ouro2026.txtAdded
results/literature-framing-review-20261007/physics31-2024.pdfAdded+3