{"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/sprig-improving-large-language-model","title":"SPRIG: Improving Large Language Model Performance by System Prompt Optimization","arxiv_id":"2410.14826","date":"2024-10-18","proceeding":null,"authors":["Lechen Zhang","Tolga Ergen","Lajanugen Logeswaran","Moontae Lee","David Jurgens"],"abstract":"Large Language Models (LLMs) have shown impressive capabilities in many scenarios, but their performance depends, in part, on the choice of prompt. Past research has focused on optimizing prompts specific to a task. However, much less attention has been given to optimizing the general instructions included in a prompt, known as a system prompt. To address this gap, we propose SPRIG, an edit-based genetic algorithm that iteratively constructs prompts from prespecified components to maximize the model's performance in general scenarios. We evaluate the performance of system prompts on a collection of 47 different types of tasks to ensure generalizability. Our study finds that a single optimized system prompt performs on par with task prompts optimized for each individual task. Moreover, combining system and task-level optimizations leads to further improvement, which showcases their complementary nature. Experiments also reveal that the optimized system prompts generalize effectively across model families, parameter sizes, and languages. This study provides insights into the role of system-level instructions in maximizing LLM potential.","url_abs":"https://arxiv.org/abs/2410.14826v2","url_pdf":"https://arxiv.org/pdf/2410.14826v2.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":"sprig-improving-large-language-model","repo_url":"https://github.com/orange0629/prompting","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.14826","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.14826"}},"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/orange0629/prompting","reach":{"status":"ok"}}],"summary":{"ran":13,"ran_draft_wrong":1,"unverified":5},"by_repo_kind":{"official":{"samples":19,"ran":14,"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":19,"samples":[{"code_sha256_prefix":"c845e58e7ef3ba34","entry":"create_save_dir","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/count_reasoning_types.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/count_reasoning_types.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":"c845e58e7ef3ba34"}},{"code_sha256_prefix":"290efba7e1ecb8c2","entry":"extract_path_components","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/classify_reasoning_types_batch.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/classify_reasoning_types_batch.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":"290efba7e1ecb8c2"}},{"code_sha256_prefix":"8452ea695318c238","entry":"format_steps","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/segmentation/segmentation.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/segmentation/segmentation.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":"8452ea695318c238"}},{"code_sha256_prefix":"9a700f6f68811df6","entry":"get_file_save_name","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/classify_reasoning_types_batch.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/classify_reasoning_types_batch.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":"9a700f6f68811df6"}},{"code_sha256_prefix":"069bc97ca5d9dc52","entry":"get_file_save_name","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/count_reasoning_types_batch.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/count_reasoning_types_batch.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":"069bc97ca5d9dc52"}},{"code_sha256_prefix":"97568c4ea3aefbe7","entry":"get_gcs_download_dir","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/count_reasoning_types_batch.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/count_reasoning_types_batch.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":"97568c4ea3aefbe7"}},{"code_sha256_prefix":"0561a2abdc6ecd47","entry":"get_gcs_upload_path","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/classify_reasoning_types_batch.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/classify_reasoning_types_batch.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":"0561a2abdc6ecd47"}},{"code_sha256_prefix":"3827108f9c3935dd","entry":"get_gcs_upload_path","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/count_reasoning_types_batch.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/count_reasoning_types_batch.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":"3827108f9c3935dd"}},{"code_sha256_prefix":"1702eb3291926377","entry":"inference_and_save","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/count_reasoning_types.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/count_reasoning_types.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":"1702eb3291926377"}},{"code_sha256_prefix":"37e7baf06cc5b2f0","entry":"parse_sectioned_prompt","repo":"orange0629/prompting","repo_kind":"official","path":"related_work/protegi/utils.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/related_work/protegi/utils.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"37e7baf06cc5b2f0"}},{"code_sha256_prefix":"6886e74e5643103d","entry":"parse_steps","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/get_behavior_result.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/get_behavior_result.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":"6886e74e5643103d"}},{"code_sha256_prefix":"d71640372878473e","entry":"predict_on_example","repo":"orange0629/prompting","repo_kind":"official","path":"related_work/protegi/scorers.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/related_work/protegi/scorers.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":"d71640372878473e"}},{"code_sha256_prefix":"aab213b0895dc732","entry":"process_example","repo":"orange0629/prompting","repo_kind":"official","path":"related_work/protegi/tasks.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/related_work/protegi/tasks.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":"aab213b0895dc732"}},{"code_sha256_prefix":"7675dd1e070692e3","entry":"strip_all_lines","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/count_reasoning_types.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/count_reasoning_types.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":"7675dd1e070692e3"}},{"code_sha256_prefix":"a1fd5f6c9eed572c","entry":"generate_latex_table","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/get_table_result.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/get_table_result.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":"a1fd5f6c9eed572c"}},{"code_sha256_prefix":"813f1b42c556fc3b","entry":"normalize_step_types","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/get_behavior_result.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/get_behavior_result.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":"813f1b42c556fc3b"}},{"code_sha256_prefix":"90e80d909d64d09f","entry":"predict_batch_step_splits","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/segmentation/segmentation.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/segmentation/segmentation.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":"90e80d909d64d09f"}},{"code_sha256_prefix":"19209ae07d7fceae","entry":"process_example_vllm","repo":"orange0629/prompting","repo_kind":"official","path":"related_work/protegi/tasks.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/related_work/protegi/tasks.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":"19209ae07d7fceae"}},{"code_sha256_prefix":"759a3fe338de2d4b","entry":"process_steps_with_normalization","repo":"orange0629/prompting","repo_kind":"official","path":"exp3/categorization/language-matters/get_behavior_result.py","file_url":"https://github.com/orange0629/prompting/blob/HEAD/exp3/categorization/language-matters/get_behavior_result.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":"759a3fe338de2d4b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}