{"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/quickllama-query-aware-inference-acceleration","title":"QuickLLaMA: Query-aware Inference Acceleration for Large Language Models","arxiv_id":"2406.07528","date":"2024-06-11","proceeding":null,"authors":["Jingyao Li","Han Shi","Xin Jiang","Zhenguo Li","Hong Xu","Jiaya Jia"],"abstract":"The capacity of Large Language Models (LLMs) to comprehend and reason over long contexts is pivotal for advancements in diverse fields. Yet, they still stuggle with capturing long-distance dependencies within sequences to deeply understand semantics. To address this issue, we introduce Query-aware Inference for LLMs (Q-LLM), a system designed to process extensive sequences akin to human cognition. By focusing on memory data relevant to a given query, Q-LLM can accurately capture pertinent information within a fixed window size and provide precise answers to queries. It doesn't require extra training and can be seamlessly integrated with any LLMs. Q-LLM using LLaMA3 (QuickLLaMA) can read Harry Potter within 30s and accurately answer the questions. On widely recognized benchmarks, Q-LLM improved by 7.17% compared to the current state-of-the-art on LLaMA3, and by 3.26% on Mistral on the $\\infty$-bench. In the Needle-in-a-Haystack and BABILong task, Q-LLM improved upon the current SOTA by 7.0% and 6.1%. Our code can be found in https://github.com/dvlab-research/Q-LLM.","url_abs":"https://arxiv.org/abs/2406.07528v2","url_pdf":"https://arxiv.org/pdf/2406.07528v2.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":"quickllama-query-aware-inference-acceleration","repo_url":"https://github.com/dvlab-research/q-llm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.07528","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.07528"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dvlab-research/q-llm","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_honours":1,"ran_draft_wrong":2,"unverified":2},"by_repo_kind":{"official":{"samples":10,"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":10,"samples":[{"code_sha256_prefix":"899f8b2f018b4018","entry":"build_chat","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/pred.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/pred.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":"899f8b2f018b4018"}},{"code_sha256_prefix":"b349b79d9cc2934b","entry":"count_score","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/metrics.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b349b79d9cc2934b"}},{"code_sha256_prefix":"2eb701a1cd15182a","entry":"f1_score","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/infinitebench_eval.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/infinitebench_eval.py","link_basis":"harvester_set","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":"2eb701a1cd15182a"}},{"code_sha256_prefix":"802c7c4f8924c4ed","entry":"inf_llm_forward","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/qllm/attention/inf_llm.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/qllm/attention/inf_llm.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":"802c7c4f8924c4ed"}},{"code_sha256_prefix":"e7e75981cb464788","entry":"normalize_answer","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/metrics.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e7e75981cb464788"}},{"code_sha256_prefix":"4b44a4d3fd80a48d","entry":"normalize_answer","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/infinitebench_eval.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/infinitebench_eval.py","link_basis":"harvester_set","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":"4b44a4d3fd80a48d"}},{"code_sha256_prefix":"8c5c581f9264c810","entry":"normalize_zh_answer","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/metrics.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8c5c581f9264c810"}},{"code_sha256_prefix":"f62b4d2a31aa1081","entry":"normalize_zh_answer","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/infinitebench_eval.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/infinitebench_eval.py","link_basis":"harvester_set","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":"f62b4d2a31aa1081"}},{"code_sha256_prefix":"cf4792986256c96a","entry":"load_infinite_bench","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/pred.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/pred.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":"cf4792986256c96a"}},{"code_sha256_prefix":"c3151b9269a537f1","entry":"stream_llm_forward","repo":"dvlab-research/q-llm","repo_kind":"official","path":"benchmark/qllm/attention/stream_llm.py","file_url":"https://github.com/dvlab-research/q-llm/blob/HEAD/benchmark/qllm/attention/stream_llm.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":"c3151b9269a537f1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}