{"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/lamal-language-modeling-is-all-you-need-for","title":"LAMOL: LAnguage MOdeling for Lifelong Language Learning","arxiv_id":"1909.03329","date":"2019-09-07","proceeding":"ICLR 2020 1","authors":["Fan-Keng Sun","Cheng-Hao Ho","Hung-Yi Lee"],"abstract":"Most research on lifelong learning applies to images or games, but not language. We present LAMOL, a simple yet effective method for lifelong language learning (LLL) based on language modeling. LAMOL replays pseudo-samples of previous tasks while requiring no extra memory or model capacity. Specifically, LAMOL is a language model that simultaneously learns to solve the tasks and generate training samples. When the model is trained for a new task, it generates pseudo-samples of previous tasks for training alongside data for the new task. The results show that LAMOL prevents catastrophic forgetting without any sign of intransigence and can perform five very different language tasks sequentially with only one model. Overall, LAMOL outperforms previous methods by a considerable margin and is only 2-3% worse than multitasking, which is usually considered the LLL upper bound. The source code is available at https://github.com/jojotenya/LAMOL.","url_abs":"https://arxiv.org/abs/1909.03329v2","url_pdf":"https://arxiv.org/pdf/1909.03329v2.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":"lamal-language-modeling-is-all-you-need-for","repo_url":"https://github.com/jojotenya/LAMOL","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"continual-learning","task_name":"Continual Learning"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"lifelong-learning","task_name":"Lifelong learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/continual-learning-on-20newsgroup-10-tasks","task":"Continual Learning","dataset":"20Newsgroup (10 tasks)","model":"LAMOL","rank_in_archive_order":6,"of":6,"metrics":{"F1 - macro":"0.4572"},"uses_additional_data":false},{"leaderboard":"/sota/continual-learning-on-asc-19-tasks","task":"Continual Learning","dataset":"ASC (19 tasks)","model":"LAMOL","rank_in_archive_order":4,"of":15,"metrics":{"F1 - macro":"0.8059"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=1909.03329","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1909.03329"}},"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/jojotenya/LAMOL","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":9},"by_repo_kind":{"official":{"samples":10,"ran":1,"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":0,"samples":[{"code_sha256_prefix":"6b5d363ab4dbf012","entry":"to_python_float","repo":"jojotenya/LAMOL","repo_kind":"official","path":"loss_scaler.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/loss_scaler.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6b5d363ab4dbf012"}},{"code_sha256_prefix":"e7014fd797aa4e75","entry":"BN_convert_float","repo":"jojotenya/LAMOL","repo_kind":"official","path":"fp16util.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/fp16util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7014fd797aa4e75"}},{"code_sha256_prefix":"f887d5ffcbc6ad3b","entry":"conversion_helper","repo":"jojotenya/LAMOL","repo_kind":"official","path":"fp16.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/fp16.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f887d5ffcbc6ad3b"}},{"code_sha256_prefix":"6063f8fe87afb580","entry":"convert_network","repo":"jojotenya/LAMOL","repo_kind":"official","path":"fp16util.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/fp16util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6063f8fe87afb580"}},{"code_sha256_prefix":"38034aa1d784464d","entry":"fp16_to_fp32","repo":"jojotenya/LAMOL","repo_kind":"official","path":"fp16.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/fp16.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"38034aa1d784464d"}},{"code_sha256_prefix":"ea22baceb9a219a1","entry":"fp32_to_fp16","repo":"jojotenya/LAMOL","repo_kind":"official","path":"fp16.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/fp16.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ea22baceb9a219a1"}},{"code_sha256_prefix":"0f21a55b40b92463","entry":"lcs","repo":"jojotenya/LAMOL","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0f21a55b40b92463"}},{"code_sha256_prefix":"989078983378be2e","entry":"lcsstr","repo":"jojotenya/LAMOL","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"989078983378be2e"}},{"code_sha256_prefix":"9919cae853c6180f","entry":"network_to_half","repo":"jojotenya/LAMOL","repo_kind":"official","path":"fp16util.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/fp16util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9919cae853c6180f"}},{"code_sha256_prefix":"b971ea3b818d09b7","entry":"normalize_text","repo":"jojotenya/LAMOL","repo_kind":"official","path":"metrics.py","file_url":"https://github.com/jojotenya/LAMOL/blob/HEAD/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b971ea3b818d09b7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}