NeSy-RAG: Neuro-Symbolic RAG for Explainable Question Answering
NeSy-RAG is a modular neuro-symbolic retrieval-augmented generation framework that synthesizes attributable Prolog modules from retrieved text to provide transparent, deterministic answers and automatically detect missing user context, achieving superior accuracy over standard RAG baselines on the ShARC benchmark.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are trying to solve a mystery, but instead of a detective, you have a super-smart, incredibly chatty robot assistant. This robot has read almost every book in the library and can tell you the answer to almost any question. This is what we call a "Large Language Model" (LLM). However, there's a catch: sometimes this robot makes things up, or "hallucinates," and when it explains its thinking, it sounds like a foggy dream rather than a clear map. You can't always tell why it gave you an answer or if it actually read the right page in the library. This is a big problem in serious fields like law or medicine, where you need to know exactly where the information came from and be sure it's true. To fix this, scientists have been trying to combine these chatty robots with "symbolic reasoning"—a type of computer logic that works like a strict, step-by-step math proof. Think of it as giving the robot a rigid checklist to follow so it can't just guess. The big question is: Can we make a robot that is both chatty enough to understand us and strict enough to be trusted?
Enter NeSy-RAG, a new framework proposed by Jonas Gann and Michael Gertz that tries to solve this puzzle. Imagine the robot's library is a massive warehouse full of loose papers (text chunks). Usually, when you ask a question, the robot grabs a few papers, reads them, and guesses the answer. NeSy-RAG does something different. When it grabs a paper, it doesn't just read it; it instantly translates that paper into a tiny, self-contained "logic puzzle" written in a language called Prolog. It's like turning a paragraph of text into a set of strict "If-Then" rules. For example, if the text says, "You can claim benefits if you are over 18," the system turns that into a rule: if age > 18, then eligible.
Here is where it gets clever. The system builds a whole collection of these logic puzzles from the papers it finds. But instead of trying to solve the whole messy library at once, it uses a special trick called "0-arity predicates." Think of this as turning every complex rule into a simple "Yes/No" question, like "Is the person over 18?" or "Is the person a citizen?" The robot then uses a smart search to find only the specific "Yes/No" questions that match your query. It stitches these together into a final logic query and runs it. Because it's running a logic program, the answer is deterministic—it's either true or false, no guessing involved. Even better, the system keeps a perfect "receipt" for every step, showing exactly which piece of text led to which rule, so you can trace the answer back to the source.
But what if the robot doesn't have enough information? Maybe you ask, "Am I eligible?" but the robot doesn't know your age. A normal robot might just guess "Yes" or "No" and hope for the best. NeSy-RAG, however, has a "knowledge-gap detector." It looks at its logic puzzle and realizes, "Hey, I'm missing a value for the 'age' variable!" Instead of guessing, it stops and asks you, "How old are you?" It keeps asking these targeted follow-up questions until it has all the pieces to solve the puzzle. This prevents the robot from making up facts.
The researchers tested this system on a dataset called ShARC, which contains legal questions about UK government benefits. They didn't train the system on this specific data; they just let it figure it out on the fly. The results were promising. NeSy-RAG got the right answer 61.1% of the time. This was significantly better than a standard "chatbot-only" system that tried to do the same thing without the logic rules, which only got 42.8% right. The new system was also faster, taking an average of 7.4 seconds per question compared to 11.4 seconds for the standard chatbot approach.
However, the paper is careful not to call this a perfect solution. The system is still a prototype. Sometimes, it gets a bit too cautious. If it's not 100% sure about a missing fact, it will ask for more information even when it might not be strictly necessary, leading it to say "I need more info" (which the researchers call "more") instead of giving a definitive "Yes" or "No." In fact, it misclassified about 31% of the "Yes" answers as "more," suggesting it generates too many "missing info" flags. While this is a bit annoying for speed, the authors note that in high-stakes situations like law, it's safer to be cautious than to be confidently wrong. The system also struggled a bit with the "irrelevant" questions, sometimes getting confused about whether a text snippet was even related to the question.
In short, NeSy-RAG shows that by turning text into strict logic puzzles and asking for missing pieces of information, we can build AI that is more transparent, more accurate, and less likely to lie. It's not a magic bullet that solves everything perfectly yet, but it's a strong step toward making AI assistants that you can actually trust with the truth.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.