{"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/lilo-learning-interpretable-libraries-by","title":"LILO: Learning Interpretable Libraries by Compressing and Documenting Code","arxiv_id":"2310.19791","date":"2023-10-30","proceeding":null,"authors":["Gabriel Grand","Lionel Wong","Maddy Bowers","Theo X. Olausson","Muxin Liu","Joshua B. Tenenbaum","Jacob Andreas"],"abstract":"While large language models (LLMs) now excel at code generation, a key aspect of software development is the art of refactoring: consolidating code into libraries of reusable and readable programs. In this paper, we introduce LILO, a neurosymbolic framework that iteratively synthesizes, compresses, and documents code to build libraries tailored to particular problem domains. LILO combines LLM-guided program synthesis with recent algorithmic advances in automated refactoring from Stitch: a symbolic compression system that efficiently identifies optimal lambda abstractions across large code corpora. To make these abstractions interpretable, we introduce an auto-documentation (AutoDoc) procedure that infers natural language names and docstrings based on contextual examples of usage. In addition to improving human readability, we find that AutoDoc boosts performance by helping LILO's synthesizer to interpret and deploy learned abstractions. We evaluate LILO on three inductive program synthesis benchmarks for string editing, scene reasoning, and graphics composition. Compared to existing neural and symbolic methods - including the state-of-the-art library learning algorithm DreamCoder - LILO solves more complex tasks and learns richer libraries that are grounded in linguistic knowledge.","url_abs":"https://arxiv.org/abs/2310.19791v4","url_pdf":"https://arxiv.org/pdf/2310.19791v4.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":"lilo-learning-interpretable-libraries-by","repo_url":"https://github.com/gabegrand/lilo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"program-synthesis","task_name":"Program Synthesis"}],"methods":[{"method_slug":null,"method_name":"Library"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.19791","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.19791"}},"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":"deterministic:regex_extraction","url":"https://github.com/gabegrand/lilo","reach":{"status":"ok"}}],"summary":{"ran":8,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"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":9,"samples":[{"code_sha256_prefix":"9d2408e1f2af97b9","entry":"cleaned_args_dict","repo":"gabegrand/lilo","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/src/utils.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":"9d2408e1f2af97b9"}},{"code_sha256_prefix":"5271d30fb9107ce2","entry":"get_domain_metadata","repo":"gabegrand/lilo","repo_kind":"official","path":"src/config_builder.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/src/config_builder.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":"5271d30fb9107ce2"}},{"code_sha256_prefix":"c7c79f4b3b08b60b","entry":"get_embedding_directory_for_domain","repo":"gabegrand/lilo","repo_kind":"official","path":"precompute_embeddings.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/precompute_embeddings.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":"c7c79f4b3b08b60b"}},{"code_sha256_prefix":"b2864df0349a34d6","entry":"get_replication_directories","repo":"gabegrand/lilo","repo_kind":"official","path":"visualize_drawings_experiments.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/visualize_drawings_experiments.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":"b2864df0349a34d6"}},{"code_sha256_prefix":"9d6fef9ca1f732f9","entry":"get_test_fns","repo":"gabegrand/lilo","repo_kind":"official","path":"evaluate_compression_model_scoring.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/evaluate_compression_model_scoring.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":"9d6fef9ca1f732f9"}},{"code_sha256_prefix":"438d1289b6a2cd2f","entry":"load_config_from_file","repo":"gabegrand/lilo","repo_kind":"official","path":"run_experiment.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/run_experiment.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":"438d1289b6a2cd2f"}},{"code_sha256_prefix":"5c1ac9733c2618bb","entry":"make_program_log_prior_buckets_iterator","repo":"gabegrand/lilo","repo_kind":"official","path":"evaluate_compression_model_scoring.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/evaluate_compression_model_scoring.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":"5c1ac9733c2618bb"}},{"code_sha256_prefix":"050950f9b5eb2dd3","entry":"mkdir_if_necessary","repo":"gabegrand/lilo","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/src/utils.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":"050950f9b5eb2dd3"}},{"code_sha256_prefix":"51792d7d8449ad0a","entry":"generate_rel_plot","repo":"gabegrand/lilo","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/gabegrand/lilo/blob/HEAD/src/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":"51792d7d8449ad0a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}