{"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/arxiv-2605-09867","title":"Continuous Latent Contexts Enable Efficient Online Learning in Transformers","arxiv_id":"2605.09867","date":"2026-05-11","proceeding":null,"authors":["Emile Anand","Abdullah Ateyeh","Xinyuan Cao","Max Dabagia"],"abstract":"Large language models (LLMs) exhibit a strong capacity for in-context learning: Given labeled examples, they can generate good predictions without parameter updates. However, many interactive settings go beyond static prediction to online decision-making, in which effective behavior demands adaptation over long multi-turn horizons in response to feedback, and efficient algorithms in these domains must use compact representations of what they have learned. Recently, continuous transformer architectures with latent chain of thought have shown promise for offline iterative tasks such as directed graph-reachability. Motivated by this, we study whether continuous latent context tokens equip transformers to more effectively realize online learning. We give explicit constructions of constant-depth transformers that implement two foundational online decision-making procedures -- the weighted majority algorithm and $Q$-learning -- by storing their algorithmic state as linear combinations of feature embeddings, using a small number of latent context tokens. We further train a small GPT-2-style transformer with latent contexts using a multi-curriculum objective that does not directly supervise the latent states. On long synthetic online prediction sequences, this model outperforms larger and more complex LLMs, including Qwen-3-14B and DeepSeek-V3. Our results suggest that continuous latent contexts provide a simple and effective persistent state for transformers to implement online learning algorithms.","url_abs":"https://arxiv.org/abs/2605.09867","url_pdf":"https://arxiv.org/pdf/2605.09867","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2605.09867","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.09867"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/emiletimothy/transformer_decisionmaker","reach":null}],"summary":{"ran":10,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":11,"ran":10,"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":"8a975ac268e61be1","entry":"build_interactive_prompt","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/interactive_api_run.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/interactive_api_run.py","link_basis":"first_harvest_node","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":"8a975ac268e61be1"}},{"code_sha256_prefix":"80a604582b34845a","entry":"compute_hard_regret","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/plot_regret.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/plot_regret.py","link_basis":"first_harvest_node","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":"80a604582b34845a"}},{"code_sha256_prefix":"0a5d599db869d49a","entry":"generate_case","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/generate_dataset.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/generate_dataset.py","link_basis":"first_harvest_node","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":"0a5d599db869d49a"}},{"code_sha256_prefix":"1c6960c26090959f","entry":"generate_dataset","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/generate_dataset.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/generate_dataset.py","link_basis":"first_harvest_node","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":"1c6960c26090959f"}},{"code_sha256_prefix":"4443f92d992c1304","entry":"get_case","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/mw_lib.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/mw_lib.py","link_basis":"first_harvest_node","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":"4443f92d992c1304"}},{"code_sha256_prefix":"725549216821836e","entry":"has_existing_run","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/interactive_api_run.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/interactive_api_run.py","link_basis":"first_harvest_node","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":"725549216821836e"}},{"code_sha256_prefix":"515c2293b719ea54","entry":"load_data","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/mw_lib.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/mw_lib.py","link_basis":"first_harvest_node","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":"515c2293b719ea54"}},{"code_sha256_prefix":"bdcaeedc5fb7d27e","entry":"mw_predictions","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/plot_regret.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/plot_regret.py","link_basis":"first_harvest_node","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":"bdcaeedc5fb7d27e"}},{"code_sha256_prefix":"689af84f508eb77b","entry":"normalize","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/mw_lib.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/mw_lib.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"689af84f508eb77b"}},{"code_sha256_prefix":"745e4f10377bd3d7","entry":"normalize","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/plot_regret.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/plot_regret.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"745e4f10377bd3d7"}},{"code_sha256_prefix":"e36976fff3060846","entry":"get_run_dir","repo":"emiletimothy/transformer_decisionmaker","repo_kind":"found_in_text","path":"llm/core/interactive_api_run.py","file_url":"https://github.com/emiletimothy/transformer_decisionmaker/blob/HEAD/llm/core/interactive_api_run.py","link_basis":"first_harvest_node","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":"e36976fff3060846"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}