{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/learning-to-plan-for-language-modeling-from","title":"Learning to Plan for Language Modeling from Unlabeled Data","arxiv_id":"2404.00614","date":"2024-03-31","proceeding":null,"authors":["Nathan Cornille","Marie-Francine Moens","Florian Mai"],"abstract":"By training to predict the next token in an unlabeled corpus, large language models learn to perform many tasks without any labeled data. However, their next-token-prediction objective arguably limits their performance in scenarios that require planning, such as writing a coherent article. In this paper, we train a module for planning the future writing process via a self-supervised learning objective. Given the textual context, this planning module learns to predict future abstract writing actions, which correspond to centroids in a clustered text embedding space. By conditioning on these actions, our model extends the successful language model formula to more abstract planning in an unsupervised way. Empirically, we demonstrate that our method improves language modeling performance in general, particularly with respect to the text structure. Because our framework uses a planner module that is unsupervised and external to the language model, new planner modules can be trained at large scale and easily be shared with the community.","url_abs":"https://arxiv.org/abs/2404.00614v2","url_pdf":"https://arxiv.org/pdf/2404.00614v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"learning-to-plan-for-language-modeling-from","repo_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.00614","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.00614"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","reach":{"status":"ok"}}],"summary":{"ran":11,"unverified":3},"by_repo_kind":{"official":{"samples":14,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":14,"samples":[{"code_sha256_prefix":"36b9bffa303911ff","entry":"bce_loss","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"models/muzero.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/models/muzero.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"36b9bffa303911ff"}},{"code_sha256_prefix":"efc543ba6ad34128","entry":"clean_text","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"eval_generations.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/eval_generations.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"efc543ba6ad34128"}},{"code_sha256_prefix":"34d8e57a3a964b1f","entry":"get_chunk_keys","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"34d8e57a3a964b1f"}},{"code_sha256_prefix":"231d0a6bcffd1e8c","entry":"get_free_gpus","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"pretorch_util.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/pretorch_util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"231d0a6bcffd1e8c"}},{"code_sha256_prefix":"b5f55a4a778cc37f","entry":"get_nlls","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"improvement_v_difficulty.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/improvement_v_difficulty.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b5f55a4a778cc37f"}},{"code_sha256_prefix":"e33d091e0e0a84f3","entry":"is_embedding_space_prediction","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"models/muzero.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/models/muzero.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e33d091e0e0a84f3"}},{"code_sha256_prefix":"f71bde6826ec769d","entry":"load_kmeans_model","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"eval_generations.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/eval_generations.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f71bde6826ec769d"}},{"code_sha256_prefix":"2bcc92df555a69f5","entry":"maybe_expand","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2bcc92df555a69f5"}},{"code_sha256_prefix":"b045b24faddec74a","entry":"maybe_unexpand","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"dataset.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b045b24faddec74a"}},{"code_sha256_prefix":"8f413d988e80297f","entry":"scalar_loss","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"models/muzero.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/models/muzero.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8f413d988e80297f"}},{"code_sha256_prefix":"55f553926509a8a0","entry":"scores_iso_codes","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"args.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/args.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"55f553926509a8a0"}},{"code_sha256_prefix":"09e9c0d9eeda992b","entry":"get_sequence_of_actions","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"eval_generations.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/eval_generations.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"09e9c0d9eeda992b"}},{"code_sha256_prefix":"d3e00ed23e7f2bc5","entry":"process_article_batch","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"create_oracle_codes.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/create_oracle_codes.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d3e00ed23e7f2bc5"}},{"code_sha256_prefix":"b1541ae798c904ff","entry":"rank_to_device","repo":"natithan/learning-to-plan-for-language-modeling-from-unlabeled-data","repo_kind":"official","path":"pretorch_util.py","file_url":"https://github.com/natithan/learning-to-plan-for-language-modeling-from-unlabeled-data/blob/HEAD/pretorch_util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b1541ae798c904ff"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}