Cost-Efficient RAG for Entity Matching with LLMs: A Blocking-based Batch Processing Framework

arXiv:2602.05708 · cs.DB, cs.CL · Submitted 2026-02-05 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.

Tom: Today's paper: "Cost-Efficient RAG for Entity Matching with LLMs".

Jane: The gist The CE-RAG4EM architecture introduces a cost-efficient Retrieval-Augmented Generation (RAG) system for entity matching that reduces computation through blocking-based batch retrieval and generation.

Tom: First, who's behind it and why it matters.

Title and authors: Tom: Now that we've looked at the mechanics, let’s just quickly go over what this paper actually proposes by title, "Cost-Efficient RAG for Entity Matching with LLMs: A Blocking-based Batch Processing Framework."

Jane: The core concept is taking a retrieval augmented generation system, which is usually very heavy on computation, and making it cost-efficient by introducing blocking.

Lu: Blocking is the technique that groups similar records from both the source and target tables together into blocks to create a blocking-based matching pair. This grouping reduces redundant retrieval across highly related queries.

Meng: So instead of sending out thousands of individual queries to the external knowledge graph, we bundle them up into fewer, bigger queries for each block.

Tom: Precisely, for each block you get an aggregated query that is then vectorized and sent to the vector database for contextual knowledge retrieval.

Jane: And after retrieving those top-ranked items from the external knowledge base, they are used to seed a triple search and graph expansion process to gather relevant triples and subgraphs.

Lu: That triple search involves breadth-first search for structurally relevant subgraphs bounded by a maximum depth Dmax, and neighborhood expansion for one-hop structural context for each entity in the top set.

Meng: It sounds like they’re layering retrieval methods—vector similarity first, then graph traversal to get more structured evidence. What’s the benefit of that extra step?

Tom: The benefit is that it allows the system to gather relevant triples and subgraphs from the external knowledge graph via BFS and EXP, which enriches what you have retrieved.

Jane: And after that enrichment stage, they refine those entities and predicates with textual statements using similarity-based ranking and instruction-tuned filtering before feeding everything into the LLM.

Lu: The paper formalizes this as RAG4EM, where context can be textual entity/predicate descriptions or KG triples for KG-RAG4EM, improving decision quality.

Meng: So it’s essentially combining the structured relational evidence from triples with the abstract knowledge from vector embeddings for a better final decision.

Tom: It’s about leveraging both types of information simultaneously to make more reliable entity matching decisions by grounding them in external data.

Jane: This sets up the foundation for how they talk to the LLM later, moving beyond just simple input records to richer contextual knowledge.

The paper's summary: Tom: Let’s go into what the paper actually summarizes about this architecture, CE-RAG4EM.

Jane: It summarizes it as a cost-efficient RAG architecture that reduces computation through blocking-based batch retrieval and generation, which is the main focus.

Lu: The summary emphasizes that this approach mitigates the quadratic complexity of per-query contextual knowledge retrieval and generation by grouping similar records into batches.

Meng: It specifically points out that the deduplication rule is key to preventing overlaps from multiple blocking keys or similarity thresholds across different blocks.

Tom: That’s right, they stress that the deduplication rule retains only the first occurrence of any matching pair in the earliest block where it appears and discards all subsequent duplicates in later blocks.

Jane: So they are detailing every step of how this batch processing works, from initial record blocking to final inference prompting.

Lu: They also detail how they employ tailored prompting strategies for both per-query generation and block-level batch generation so the LLM can effectively leverage ranked Top-k knowledge to produce accurate decisions.

Meng: That means they aren't just throwing a general prompt at the LLM; they’re giving it specific instructions on how to use the retrieved context.

Tom: They are essentially showing how this structured approach lets the LLM utilize that ranked Top-k knowledge to produce more accurate entity matching decisions.

Jane: This is crucial because it moves them from just hoping the LLM finds a match to actively giving it high-quality, relevant context to use.

The paper's improvements: Tom: Okay, what about the specific improvements they propose in terms of methodology? What are the key methodological shifts here?

Lu: One major improvement is moving from vanilla RAG to a unified framework for analyzing and evaluating RAG systems, focusing on blocking-aware optimizations and retrieval granularity.

Jane: They also introduce the idea of separating node-level retrieval from triple-level traversal based on whether the attributes are textual or numeric or mixed.

Tom: That context-adaptive granularity strategy is a significant improvement because it allows for targeted knowledge retrieval based on attribute types, which is much smarter than just picking one way to do it.

Meng: I see how that saves compute resources because you aren't wasting effort searching for triples when you know the attributes are already clear.

Jane: It’s a more sophisticated way of handling the complexity of entity matching by tailoring the search strategy to what the data actually looks like.

Conclusion: Tom: To wrap up this discussion, what’s our final summary of what this paper means for us as we look at CE-RAG4EM?

Jane: Basically, it successfully addresses the computational inefficiency in adapting RAG for entity matching by introducing blocking-based batch retrieval and inference.

Lu: The overall implication is that we can now build scalable, cost-efficient systems that compete with larger LLMs because they significantly reduce retrieval and inference cost.

Meng: For production, I’m still cautious about the trade-offs between recall and precision in batch generation versus per-query execution.

Tom: The final recommendation from the paper is to prioritize batch retrieval as the default configuration to lower retrieval costs while leveraging shared contextual knowledge across all those pairs.

Jane: And they suggest using robust blocking methods like QGram or XQGram, and adopting a context-adaptive granularity strategy where you use node-level retrieval for high-confidence blocks and reserve triple-level traversal for ambiguous cases.

Lu: It’s a practical guideline for designing these systems without compromising the F1 score when dealing with the trade-off between retrieval reuse and cost reduction.

Meng: And remember, we have to be pragmatic about choosing our model size, prioritizing smaller then medium models when they are grounded with high-value contextual knowledge.

Tom: So in conclusion, the paper "Cost-Efficient RAG for Entity Matching with LLMs: A Blocking-based Batch Processing Framework" gives us a concrete framework for building reliable and cost-efficient RAG systems for real world data integration.

Aalborg University · University of Amsterdam · Bowling Green State University, USA · BIFOLD & TU Berlin

cs.DB, cs.CL

Submitted: 2026-02-05

Updated: 2026-10-15

Comments: Extended version of the paper accepted at ACM SIGMOD 2027

DOI: 10.1145/3856323

Code: https://github.com/machuangtao/CE-RAG4EM

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 83/100

The gist: The gist The CE-RAG4EM architecture introduces a cost-efficient Retrieval-Augmented Generation (RAG) system for entity matching that reduces computation through blocking-based batch retrieval and

Key concepts

Blocking-based Matching Pair Generation
This process groups similar entity records from source and target tables into 'blocks.' Instead of checking every single pair individually, the system matches pairs within these blocks. This significantly reduces the number of expensive retrieval calls needed to find initial candidate matches.
Contextual Knowledge Retrieval
The system uses vector similarity to search an external knowledge graph (KG) for relevant entities and predicates based on a matching query. A pre-trained model converts the query and KG elements into numerical vectors, allowing the system to efficiently pull the most contextually relevant information from the large KG.
Triple Search and Expansion
After retrieving initial entities, this step uses structural knowledge from the KG to find related information. It employs Breadth-First Search (BFS) and neighborhood expansion (EXP) to explore related triples and subgraphs around the retrieved items, gathering richer context for the matching decision.
Blocking-based Batch Inference
Instead of generating answers one pair at a time, this strategy groups queries within a block. The LLM then processes all queries in that batch together using tailored prompts. This single call to the LLM reduces overhead and leverages shared contextual knowledge for faster, more efficient decision-making.

Terminology

Summary

The gist The CE-RAG4EM architecture introduces a cost-efficient Retrieval-Augmented Generation (RAG) system for entity matching that reduces computation through blocking-based batch retrieval and generation.

How it works

  1. CE-RAG4EM provides a cost-efficient RAG pipeline for EM, summarized in Figure 2, which begins with blocking on the raw entity records from the source table and the target table to create a blocking-based matching pair by grouping similar records across tables into the same block and deduplicating the redundant matching pairs across blocks (3).

  2. For each block, entity matching queries are created for each matching pair, and these queries are then concatenated within the block for an aggregated query that is further vectorized and sent to the vector database of KG for contextual knowledge retrieval (3).

  3. Top-ranked retrieved items then seed triple search and graph expansion, enabling the system to gather relevant triples and subgraphs from the external KG via breadth-first search and neighborhood expansion within the triple-search module (3).

  4. Retrieved entities and predicates–along with those discovered during triple search–are enriched with textual statements and refined using similarity-based ranking and instruction-tuned filtering in the knowledge enrichment and refinement stage (3).

  5. CE-RAG4EM employs tailored prompting strategies for both per-query generation and block-level batch generation, enabling the LLM to effectively leverage ranked Top-k knowledge to produce accurate EM decisions (3).

Blocking-based Matching Pair Generation

The blocking process mitigates the quadratic complexity of per-query contextual knowledge retrieval and generation by grouping similar records into the same batch, reducing redundant retrieval across highly related queries (3.2). The process involves three phases: Records Preprocessing and Block Generation, Candidate Pair Generation within a Block, and Deduplication (3.2). To prevent overlap from multiple blocking keys or similarity thresholds, a deduplication rule retains only the first occurrence of any matching pair in the earliest block where it appears, discarding all subsequent duplicates in later blocks (3.2).

Contextual Knowledge Retrieval

The contextual knowledge retrieval component relies on vector-based retrieval using dense vector similarity to identify and return the Top-k entities and predicates from the external knowledge graph that are most relevant to a given entity matching query (3.3). A pre-trained encoder model is utilized to map the EM query as well as the entities and predicates in G into a d-dimensional embedding space, where relevance score between the given query q and each entity or predicate is quantified via cosine similarity (3.4). Based on this ranking, Top-k relevant entities Vk and predicates Pk are obtained, which provide inputs for the subsequent triple search and expansion (3.4).

Triple Search and Expansion

Following vector-based retrieval, a triple search and expansion procedure leverages explicit structural knowledge by exploring and expanding the retrieved items into triples over G using breadth-first search (BFS) and neighborhood-based expansion (EXP) (3.4). BFS extracts structurally relevant subgraphs by performing a BFS-based triple search over the external knowledge graph G, bounded by a maximum depth Dmax, while EXP focuses on one-hop structural context for each entity in the Top-k set Vk (3.4).

Knowledge Enrichment and Refinement

Knowledge enrichment augments each retrieved entity and predicate with its corresponding textual description from external KG to transform abstract identifiers into interpretable text, resulting in the form identifier (description) (3.5). Ranking-based knowledge refinement filters and retains only the most relevant contextual knowledge for augmentation by ranking EXP-generated triples by the dense similarity of the seed entity to the query and their sequence order, while also applying instruction tuning based knowledge refinement to remove irrelevant or unhelpful contextual information before LLM inference (3.5).

Inference Augmentation

The system employs two tailored prompt instructions for inference: a Prompt for Per-Query Inference, which integrates refined contextual knowledge retrieved from the external KG into the prompt, and a Prompt for Blocking-Based Batch Inference, which combines aggregated queries within a block with their corresponding retrieved contextual knowledge and a shared instruction prompt to enable the LLM to generate answers for the entire batch in a single call (3.6).

Representative CE-RAG4EM Solutions

The design space of CE-RAG4EM is structured around two core dimensions: Blocking-based Optimization (BO) and Retrieval Granularity (RG) (3.7). Representative solutions include CE-RAG4EM-BR, which enables both Batch Retrieval and Batch Generation, as well as CE-KG-RAG4EM variants that incorporate KG traversal. The paper recommends tuning the maximum block size dynamically based on attribute types and context window limits, suggesting a range of 4–6 provides a strong balance between retrieval reuse and cost reduction without compromising F1 (5).

Summary of Empirical Findings

The empirical evaluation shows that CE-RAG4EM outperforms LLM-EM on all nine datasets in terms of F1, with gains primarily driven by recall, indicating that retrieved external evidence helps the LLM identify additional true matches (4.2). The trade-off between retrieval granularity reveals that KG-RAG configurations using EXP or BFS achieve higher recall on ambiguous pairs with numeric or mixed-type attributes compared to node-level RAG (5.1). Furthermore, batch generation (CE-RAG4EM-BG) tends to increase recall but can reduce precision due to cross-pair coupling, while batch retrieval (CE-RAG4EM-BR) preserves a more stable balance and reduces inference time per pair compared to per-query execution (4.3). The optimal design involves using robust blocking methods like QGram or XQGram and adopting a context-adaptive granularity strategy where node-level retrieval is used for high-confidence blocks, reserving triple-level traversal for ambiguous cases (5.2). Finally, lightweight backbone models benefit more from external grounding, while batch retrieval should be the default configuration to lower retrieval costs (5.1).

Recommendation for Design Choices

The paper recommends tuning the maximum block size dynamically based on attribute types and context window limits, suggesting a range of 4–6 provides a strong balance between retrieval reuse and cost reduction without compromising F1 (5). It is also recommended to prioritize batch retrieval and inference with robust blocking, as this lowers retrieval costs while leveraging shared contextual knowledge (5.2). A context-adaptive granularity strategy is preferable: use node-level retrieval for high-confidence blocks with textual or date attributes, and reserve triple-level traversal (BFS) for ambiguous cases involving numeric, categorical, or mixed attributes (5.2). Finally, the paper suggests prioritizing small then medium models as they deliver strong performance gains when grounded with high-value contextual knowledge while maintaining an F1-cost balance (5.1).

Related Work

The work builds upon PLM and LLM-based Entity Matching, which model the task as a binary sequence pair classification task (6.1). RAG, GraphRAG, and KG-RAG enhance LLMs by integrating structured graph-based knowledge rather than relying on textual chunks (6.2). Blocking is used to remove likely non-matching pairs when creating candidate pairs from raw tables or to select subsets of pairs through combined strategies (6.1). The paper introduces a blocking-based batch construction strategy that enables efficient batch retrieval and querying for RAG-based entity matching, which is novel in the context of RAG and KG-RAG (3).

Conclusion

CE-RAG4EM successfully addresses the computational inefficiency in adapting RAG for entity matching by introducing blocking-based batch retrieval and inference, demonstrating that it significantly reduces retrieval and inference cost while allowing smaller open-source models to compete with larger LLMs (7). The empirical findings offer a practical guideline for building scalable, cost-efficient, and highly reliable RAG systems for data integration in real-world data engineering (7).

--- Page 15 ---

References [1] Ioannis Arvanitis-Kasinikos and George Papadakis. 2025. Entity Matching with 7B LLMs: A Study on Prompting Strategies and Hardware Limitations. In DOLAP (CEUR Workshop Proceedings), Vol. 3931, 31–38 [1]. [2] Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, and Hannaneh Hajishirzi. 2024. Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection. In ICLR [2]. [3] Fabio Azzalini, Songle Jin, Marco Renzi, and Letizia Tanca. 2021. Blocking Techniques for Entity Linkage: A Semantics-Based Approach. Data Sci. Eng., 6(1) (2021), 20–38 [3]. [4] Nils Barlaug and Jon Atle Gulla. 2021. Neural Networks for Entity Matching: A Survey. ACM Trans. Knowl. Discov. Data, 15(3) (2021), 1–37 [4]. [5] Jan-Micha Bodensohn, Ulf Brackmann, Liane Vogel, Anupam Sanghi, and Carsten Binnig. 2025. Unveiling Challenges for LLMs in Enterprise Data Engineering. Proc. VLDB Endow., 19(2) (2025), 196–209 [5]. [6] Yukun Cao, Zengyi Gao, Zhiyang Li, Xike Xie, S. Kevin Zhou, and Jianliang Xu. 2025. LEGO-GraphRAG: Modularizing Graph-based Retrieval-Augmented Generation for Design Space Exploration. Proc.

Improvements for AI systems

  1. Bold Header: Adaptive Block Size Tuning

This improvement dynamically adjusts block size based on attribute types to balance performance and cost, as suggested by Empirically, a block-size range of 4–6 provides strong retrieval reuse and reduces retrieval and inference cost without compromising F1.

  1. Bold Header: Hybrid Retrieval Granularity Selection

The system should adopt a Context-adaptive Retrieval Granularity strategy, using node-level retrieval for high-confidence blocks (textual/date attributes) and reserving triple-level traversal (BFS) for ambiguous cases involving numeric, categorical, or mixed attributes.

  1. Bold Header: Dual Filtering Pipeline for KG-RAG

Implement a hybrid filtering strategy by combining ranking-based triple refinement with instruction-guided prompt filtering to remove noisy knowledge at multiple stages before LLM inference.

Abstract

Large language models (LLMs) offer a compelling approach to entity matching (EM) in label-scarce settings, yet their matching quality is sensitive to records with ambiguous or sparse attributes due to the absence of external factual grounding. Retrieval-augmented generation (RAG) directly addresses this grounding gap by retrieving and injecting relevant external knowledge. However, naively applying RAG to large-scale EM is expensive due to per-pair retrieval calls over large knowledge graphs (KGs) and the increase in input tokens caused by enriching prompts with retrieved contextual knowledge. To address the above limitation, we introduce a CE-RAG4EM (Cost-Efficient RAG for Entity Matching) framework that reduces overhead through blocking-based batch retrieval and generation. We investigate the benefits of this framework through a systematic analysis of RAG systems for entity matching, focusing on blocking-aware batch optimizations and retrieval granularity. Extensive experiments on nine widely used real-world entity matching benchmark datasets show that CE-RAG4EM under a zero-shot setting achieves comparable or improved matching quality while substantially reducing end-to-end overhead. The results demonstrate that our CE-RAG4EM closes the knowledge grounding gap of the LLM-EM baseline and yields significant improvements in F1 scores on datasets with ambiguous or numerically sparse attributes, while its batch retrieval and inference substantially reduce the overhead and maintain competitive matching quality compared to naive RAG4EM. Our analysis identifies clear performance-overhead trade-offs across blocking-based batch sizes and retrieval granularity, showing how matching quality and computational cost shift with each design choice. These findings offer concrete guidance for building scalable, efficient RAG systems for entity matching that balance accuracy and cost.

Sources

Related papers