{"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/dynamic-chunking-and-selection-for-reading","title":"Dynamic Chunking and Selection for Reading Comprehension of Ultra-Long Context in Large Language Models","arxiv_id":"2506.00773","date":"2025-06-01","proceeding":null,"authors":["Boheng Sheng","Jiacheng Yao","Meicong Zhang","Guoxiu He"],"abstract":"Large language models (LLMs) often struggle to accurately read and comprehend extremely long texts. Current methods for improvement typically rely on splitting long contexts into fixed-length chunks. However, fixed truncation risks separating semantically relevant content, leading to ambiguity and compromising accurate understanding. To overcome this limitation, we propose a straightforward approach for dynamically separating and selecting chunks of long context, facilitating a more streamlined input for LLMs. In particular, we compute semantic similarities between adjacent sentences, using lower similarities to adaptively divide long contexts into variable-length chunks. We further train a question-aware classifier to select sensitive chunks that are critical for answering specific questions. Experimental results on both single-hop and multi-hop question-answering benchmarks show that the proposed approach consistently outperforms strong baselines. Notably, it maintains robustness across a wide range of input lengths, handling sequences of up to 256k tokens. Our datasets and code are available at the following link: https://github.com/ECNU-Text-Computing/DCS","url_abs":"https://arxiv.org/abs/2506.00773v2","url_pdf":"https://arxiv.org/pdf/2506.00773v2.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":"dynamic-chunking-and-selection-for-reading","repo_url":"https://github.com/ecnu-text-computing/dcs","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"chunking","task_name":"Chunking"},{"task_slug":"multi-hop-question-answering","task_name":"Multi-hop Question Answering"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"reading-comprehension","task_name":"Reading Comprehension"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2506.00773","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2506.00773"}},"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/ECNU-Text-Computing/DCS","reach":null}],"summary":{"ran_draft_wrong":3,"ran":4,"ran_fixture":1,"ran_violates":1},"by_repo_kind":{"official":{"samples":9,"ran":9,"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":"ac05385d5416a956","entry":"calculate_cosine_distances","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ac05385d5416a956"}},{"code_sha256_prefix":"fab419bb269242a4","entry":"chunk_com","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.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":"fab419bb269242a4"}},{"code_sha256_prefix":"98d6f09b0f94434e","entry":"chunk_gen","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.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":"98d6f09b0f94434e"}},{"code_sha256_prefix":"342a38431851494e","entry":"chunk_re_gen","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"342a38431851494e"}},{"code_sha256_prefix":"05174a27a000c05a","entry":"combine_sentences","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.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":"05174a27a000c05a"}},{"code_sha256_prefix":"91467442d43e757d","entry":"cosine_similarity","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"91467442d43e757d"}},{"code_sha256_prefix":"dd97bd6d8181e354","entry":"sentence_chunking","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.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":"dd97bd6d8181e354"}},{"code_sha256_prefix":"83212d1183d655a4","entry":"sentence_chunking_main","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"83212d1183d655a4"}},{"code_sha256_prefix":"ec3b031cb417d57c","entry":"sentence_split","repo":"ECNU-Text-Computing/DCS","repo_kind":"official","path":"sentence_chunk.py","file_url":"https://github.com/ECNU-Text-Computing/DCS/blob/HEAD/sentence_chunk.py","link_basis":"first_harvest_node","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":"ec3b031cb417d57c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}