{"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/matryoshka-learning-to-drive-black-box-llms","title":"Matryoshka: Learning to Drive Black-Box LLMs with LLMs","arxiv_id":"2410.20749","date":"2024-10-28","proceeding":null,"authors":["Changhao Li","Yuchen Zhuang","Rushi Qiang","Haotian Sun","Hanjun Dai","Chao Zhang","Bo Dai"],"abstract":"Despite the impressive generative abilities of black-box large language models (LLMs), their inherent opacity hinders further advancements in capabilities such as reasoning, planning, and personalization. Existing works aim to enhance LLM capabilities via domain-specific adaptation or in-context learning, which require additional training on accessible model parameters, an infeasible option for black-box LLMs. To address this challenge, we introduce Matryoshika, a lightweight white-box LLM controller that guides a large-scale black-box LLM generator by decomposing complex tasks into a series of intermediate outputs. Specifically, we consider the black-box LLM as an environment, with Matryoshika serving as a policy to provide intermediate guidance through prompts for driving the black-box LLM. Matryoshika is trained to pivot the outputs of the black-box LLM aligning with preferences during iterative interaction, which enables controllable multi-turn generation and self-improvement in optimizing intermediate guidance. Empirical evaluations on three diverse tasks demonstrate that Matryoshika effectively enhances the capabilities of black-box LLMs in complex, long-horizon tasks, including reasoning, planning, and personalization. By leveraging this pioneering controller-generator framework to mitigate dependence on model parameters, Matryoshika provides a transparent and practical solution for improving black-box LLMs through controllable multi-turn generation using white-box LLMs.","url_abs":"https://arxiv.org/abs/2410.20749v1","url_pdf":"https://arxiv.org/pdf/2410.20749v1.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":[],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.20749","atlas_url":"https://app.syntology.ai/?focus=2410.20749","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.20749"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"deterministic:regex_extraction","url":"https://github.com/lichangh20/Matryoshka","reach":{"status":"ok"}}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":6,"ran":2,"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":6,"samples":[{"code_sha256_prefix":"60d73ddf6afc1bc3","entry":"compute_approx_kl","repo":"lichangh20/Matryoshka","repo_kind":"found_in_text","path":"models/utils.py","file_url":"https://github.com/lichangh20/Matryoshka/blob/HEAD/models/utils.py","link_basis":"plan_row","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":"60d73ddf6afc1bc3"}},{"code_sha256_prefix":"959df7824bf09cc1","entry":"log_probs_from_logits","repo":"lichangh20/Matryoshka","repo_kind":"found_in_text","path":"models/actor.py","file_url":"https://github.com/lichangh20/Matryoshka/blob/HEAD/models/actor.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"959df7824bf09cc1"}},{"code_sha256_prefix":"99a2d91ea5aed978","entry":"compute_reward","repo":"lichangh20/Matryoshka","repo_kind":"found_in_text","path":"models/utils.py","file_url":"https://github.com/lichangh20/Matryoshka/blob/HEAD/models/utils.py","link_basis":"plan_row","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":"99a2d91ea5aed978"}},{"code_sha256_prefix":"a68c73a9ac646069","entry":"masked_mean","repo":"lichangh20/Matryoshka","repo_kind":"found_in_text","path":"models/utils.py","file_url":"https://github.com/lichangh20/Matryoshka/blob/HEAD/models/utils.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":"a68c73a9ac646069"}},{"code_sha256_prefix":"e8baf512d6e432c8","entry":"parse_solution","repo":"lichangh20/Matryoshka","repo_kind":"found_in_text","path":"gsm_generate_data.py","file_url":"https://github.com/lichangh20/Matryoshka/blob/HEAD/gsm_generate_data.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":"e8baf512d6e432c8"}},{"code_sha256_prefix":"dfb17eb3e6eaed35","entry":"process_ob","repo":"lichangh20/Matryoshka","repo_kind":"found_in_text","path":"alfworld_generate_data.py","file_url":"https://github.com/lichangh20/Matryoshka/blob/HEAD/alfworld_generate_data.py","link_basis":"harvester_set","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":"dfb17eb3e6eaed35"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}