Soroush Omidvartehrani, Mohammadamin Habibollah, Mohammadreza Daviran, Davood Rafiei
5 min
Large language models (LLMs) are increasingly used for table-centric data wrangling tasks, such as entity resolution, schema alignment, and anomaly detection. While in-context learning is a powerful tool for these tasks, its performance is highly sensitive to the quality of the provided demonstrations. Standard retrieval methods often select examples based on similarity to the query, which can reinforce a model's existing biases or likely predictions rather than helping it navigate difficult decision boundaries. This paper investigates whether selecting demonstrations that specifically highlight these boundaries can improve performance without requiring model retraining or task-specific engineering.
The authors propose EdgeLM, a task-agnostic framework for demonstration selection. Instead of relying solely on similarity, EdgeLM retrieves two types of "edge evidence":
EdgeLM combines these two types of evidence into a single prompt, keeping the total number of demonstrations within a fixed budget. The method is evaluated across five data wrangling tasks, fifteen datasets, and five different LLMs (both open-weight and proprietary).
EdgeLM consistently outperforms or matches standard retrieval methods across all tested models and tasks. The authors demonstrate that the two forms of edge evidence—data edges and model edges—provide complementary benefits. While similarity-based retrieval is effective for establishing general context, the addition of boundary-focused demonstrations helps the model resolve ambiguous cases where simple similarity would otherwise lead to incorrect predictions. The framework is shown to be robust across different model architectures and scales, requiring only a small, one-time precomputation step to identify model-specific errors.
This work provides a simple, effective, and model-agnostic way to improve the reliability of LLMs in structured data tasks. By shifting the focus from mere similarity to decision-boundary awareness, the authors offer a practical solution for practitioners who need to improve model accuracy on complex data wrangling tasks without the high cost of fine-tuning or complex prompt engineering.
Large language models (LLMs) perform table-centric prediction through in-context learning, making demonstration selection critical to performance. Existing retrieval methods prioritize similarity to the query, but similar demonstrations often reinforce the model's likely prediction rather than reveal the distinctions needed for difficult decisions. We propose EdgeLM, a retrieval framework that instead selects edge evidence, demonstrations that are both relevant to the query and informative about the decision boundary. EdgeLM retrieves two complementary forms of edge evidence by selecting data edges, nearby examples with different ground-truth labels, and model edges, similar examples previously misclassified by the deployed model. EdgeLM requires neither model retraining nor task-specific engineering. Across five data wrangling tasks, fifteen datasets, and five open-weight and proprietary LLMs, EdgeLM consistently achieves the best or near-best performance in every setting, while ablations show that the two forms of edge evidence provide complementary benefits. Our code and datasets are publicly available at https://github.com/soroushomidvar/EdgeLM.
Sam: So it's using the model's own track record against it, in a good way. Does this require retraining the whole model?
Alex: No, and that's a notable feature of this approach. It requires no retraining or fine-tuning at all. You're only changing what examples you put in front of the model before it answers. That makes it much easier to use in real-world systems where rebuilding the model from scratch isn't practical.
Sam: So you're essentially curating the "textbook" the model reads right before it answers a question—making sure it contains the most confusing problems, not just the easy ones.
Alex: That's an accurate way to put it. And the structure matters too. Data-edge examples come first in the prompt, establishing the general boundary between two similar answers. Then the model-edge examples follow, applying that same logic to the model's own past errors. It's a deliberate sequence, not just a pile of examples.
Sam: Does model size affect how much it benefits from this?
Alex: The paper finds the gains are consistent across models of different sizes. The improvement tends to be most noticeable in tasks where the model previously struggled—like identifying rare anomalies—which makes sense. If you're already doing well, there's less room to improve. But where the model has a genuine weak spot, targeted examples make a meaningful difference.
Sam: Is there a cost to this approach?
Alex: The main trade-off is that it requires a small pool of labeled examples to draw from. You need some reference data to define those boundaries in the first place, so it can't work in a completely zero-shot setting—where the model has no examples at all. But the paper suggests the performance gains justify that requirement in most professional contexts.
Sam: Where do the researchers see this going?
Alex: The authors point toward what they describe as "active teaching" systems—where the model might eventually generate its own corrective examples in real time, rather than relying on a pre-existing pool. That would be a meaningful shift: a model that identifies its own blind spots and builds its own remedial practice problems.
Sam: Self-correction without an external supervisor. That's a logical next step.
Alex: It is. And what this research demonstrates, more broadly, is that the quality of the examples you show a model matters as much as the model itself. Sometimes the more effective path isn't building something larger—it's being more deliberate about what you put in front of what you already have. Thanks for listening to ResearchPod.