{"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/seer-a-knapsack-approach-to-exemplar","title":"SEER : A Knapsack approach to Exemplar Selection for In-Context HybridQA","arxiv_id":"2310.06675","date":"2023-10-10","proceeding":null,"authors":["Jonathan Tonglet","Manon Reusens","Philipp Borchert","Bart Baesens"],"abstract":"Question answering over hybrid contexts is a complex task, which requires the combination of information extracted from unstructured texts and structured tables in various ways. Recently, In-Context Learning demonstrated significant performance advances for reasoning tasks. In this paradigm, a large language model performs predictions based on a small set of supporting exemplars. The performance of In-Context Learning depends heavily on the selection procedure of the supporting exemplars, particularly in the case of HybridQA, where considering the diversity of reasoning chains and the large size of the hybrid contexts becomes crucial. In this work, we present Selection of ExEmplars for hybrid Reasoning (SEER), a novel method for selecting a set of exemplars that is both representative and diverse. The key novelty of SEER is that it formulates exemplar selection as a Knapsack Integer Linear Program. The Knapsack framework provides the flexibility to incorporate diversity constraints that prioritize exemplars with desirable attributes, and capacity constraints that ensure that the prompt size respects the provided capacity budgets. The effectiveness of SEER is demonstrated on FinQA and TAT-QA, two real-world benchmarks for HybridQA, where it outperforms previous exemplar selection methods.","url_abs":"https://arxiv.org/abs/2310.06675v2","url_pdf":"https://arxiv.org/pdf/2310.06675v2.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":"seer-a-knapsack-approach-to-exemplar","repo_url":"https://github.com/jtonglet/seer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"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"},{"task_slug":"question-answering","task_name":"Question Answering"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"grouped-convolution","method_name":"Grouped Convolution"},{"method_slug":"lars","method_name":"LARS"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"regnety","method_name":"RegNetY"},{"method_slug":"seer","method_name":"SEER"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"squeeze-and-excitation-block","method_name":"Squeeze-and-Excitation Block"},{"method_slug":"swav","method_name":"SwAV"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2310.06675","atlas_url":"https://app.syntology.ai/?focus=2310.06675","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.06675"}},"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/jtonglet/SEER","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":3,"ran_honours":2,"unverified":10},"by_repo_kind":{"official":{"samples":16,"ran":6,"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":"aee9ad37b0ad6acc","entry":"eval_program","repo":"jtonglet/SEER","repo_kind":"official","path":"evaluate_finqa.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/evaluate_finqa.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aee9ad37b0ad6acc"}},{"code_sha256_prefix":"51e425104cc5286c","entry":"get_candidates_fixed_set","repo":"jtonglet/SEER","repo_kind":"official","path":"baselines.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/baselines.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":"51e425104cc5286c"}},{"code_sha256_prefix":"4dfc9cdf96088786","entry":"get_random_set","repo":"jtonglet/SEER","repo_kind":"official","path":"baselines.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/baselines.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":"4dfc9cdf96088786"}},{"code_sha256_prefix":"94fa99da8d852874","entry":"gold_program_eval","repo":"jtonglet/SEER","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/evaluation.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":"94fa99da8d852874"}},{"code_sha256_prefix":"23577faa1c9d855a","entry":"process_row","repo":"jtonglet/SEER","repo_kind":"official","path":"evaluate_finqa.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/evaluate_finqa.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"23577faa1c9d855a"}},{"code_sha256_prefix":"6289f3a9b8166f42","entry":"str_to_num","repo":"jtonglet/SEER","repo_kind":"official","path":"evaluate_finqa.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/evaluate_finqa.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6289f3a9b8166f42"}},{"code_sha256_prefix":"9245a4a89caa9029","entry":"create_hf_dataset_finqa","repo":"jtonglet/SEER","repo_kind":"official","path":"finetune_bert.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/finetune_bert.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":"9245a4a89caa9029"}},{"code_sha256_prefix":"cb8455b1e8c8bd7d","entry":"create_test_text_finqa","repo":"jtonglet/SEER","repo_kind":"official","path":"finetune_bert.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/finetune_bert.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":"cb8455b1e8c8bd7d"}},{"code_sha256_prefix":"7384579da6eea90a","entry":"create_train_text_finqa","repo":"jtonglet/SEER","repo_kind":"official","path":"finetune_bert.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/finetune_bert.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":"7384579da6eea90a"}},{"code_sha256_prefix":"741a06e5d4794c85","entry":"few_shot_chat_prompting","repo":"jtonglet/SEER","repo_kind":"official","path":"codex_run.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/codex_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":"741a06e5d4794c85"}},{"code_sha256_prefix":"8339cb160618ab6e","entry":"few_shot_prompting","repo":"jtonglet/SEER","repo_kind":"official","path":"codex_run.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/codex_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":"8339cb160618ab6e"}},{"code_sha256_prefix":"03f4b1c5c9cf651d","entry":"get_kate_set","repo":"jtonglet/SEER","repo_kind":"official","path":"baselines.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/baselines.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":"03f4b1c5c9cf651d"}},{"code_sha256_prefix":"aca0b27eb683ac2c","entry":"get_prompt_instance_finqa","repo":"jtonglet/SEER","repo_kind":"official","path":"generate_prompt.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/generate_prompt.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":"aca0b27eb683ac2c"}},{"code_sha256_prefix":"b7a03007a38c7ae3","entry":"get_prompt_instance_tatqa","repo":"jtonglet/SEER","repo_kind":"official","path":"generate_prompt.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/generate_prompt.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":"b7a03007a38c7ae3"}},{"code_sha256_prefix":"340f562c1baaec58","entry":"get_prompt_modality_finqa","repo":"jtonglet/SEER","repo_kind":"official","path":"generate_prompt.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/generate_prompt.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":"340f562c1baaec58"}},{"code_sha256_prefix":"e643b9c8cee2f454","entry":"map_string","repo":"jtonglet/SEER","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/jtonglet/SEER/blob/HEAD/evaluation.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":"e643b9c8cee2f454"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}