Augmenting RAG with nonnegative matrix factorization-driven semantic chunking in embedding space
摘要
Retrieval-augmented generation (RAG) systems enhance large language models by incorporating external knowledge sources; however, their effectiveness heavily relies on the quality of text chunking strategies. This study introduces a novel document chunking technique based on nonnegative matrix factorization (NMF), exploring two variants based on KL divergence and Frobenius norm. The method breaks down sentence embeddings into latent topics, grouping thematically related sentences—including non-adjacent ones—while preserving contextual richness. The approach is tested across several datasets (NarrativeQA, Qasper, HotpotQA, MuSiQue) within a RAG pipeline, demonstrating superior performance over existing methods. A nonparametric contrast estimation test is conducted to compare the proposed NMF-based method with both heuristic and other semantic chunking approaches. The outcome of the test confirms the superiority of NMF-based chunking over baseline methods (fixed-length, recursive, and K-means semantic, DBSCAN), showing significantly better performance in tasks such as long-form narrative understanding and multi-hop question-answering. This statistical validation aligns with empirical results, where NMF methods achieve top accuracies across GPT-4o (65.5%, 37%, and 16.5% on HotpotQA, MuSiQue, and NarrativeQA, respectively, using GLM-4-9B-Chat) and DeepSeek evaluations (69%, 41%, and 18.5% on the same datasets using GLM-4-9B-Chat), while remaining competitive on Qasper. These findings demonstrate that NMF is an effective and scalable chunking strategy, ensuring precise and context-aware responses in AI-driven applications. The method benefits from GPU-accelerated high-performance computing, achieving up to 19.6