← Latest papers
💬 NLP

Solving Zebra Puzzles Using Constraint-Guided Multi-Agent Systems

This paper introduces ZPS, a constraint-guided multi-agent system that combines Large Language Models with an off-the-shelf theorem prover to generate and refine SMT code for solving complex Zebra puzzles, demonstrating significant accuracy improvements over standalone LLMs.

Original authors: Shmuel Berman, Kathleen McKeown, Baishakhi Ray

Published 2026-06-04
📖 4 min read☕ Coffee break read

Original authors: Shmuel Berman, Kathleen McKeown, Baishakhi Ray

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 very tricky logic puzzle, like the famous "Zebra Puzzle" where you have to figure out who lives in which house, what color it is, what pet they have, and what sport they play, based only on a few confusing sentences.

This paper is about teaching a computer (specifically, a Large Language Model or LLM) how to solve these puzzles much better than it could on its own. Here is how they did it, explained simply:

The Problem: The Computer Gets Confused

Think of an LLM like a very smart, well-read student who is great at writing essays but sometimes struggles with strict math rules. When you ask it to solve a logic puzzle, it tries to guess the answer based on patterns.

  • The Issue: Logic puzzles require perfect precision. If the student misinterprets one tiny clue (like "The person with the fish lives to the left of the cat"), the whole answer falls apart.
  • The Result: On its own, the computer student gets the answer right only about 24% of the time. It's like a student who knows the vocabulary but keeps making calculation errors.

The Solution: A Team of Specialists

The authors built a system called ZPS (Zebra Puzzle Solver). Instead of asking one computer to do everything, they created a team of three agents (specialized AI workers) that work together like a construction crew:

  1. The Architect (Decomposition Agent):

    • Role: This agent reads the messy, confusing puzzle clues and breaks them down into small, manageable blueprints. It organizes the chaos into a clear list of rules.
    • Analogy: Imagine a foreman who takes a messy pile of instructions and sorts them into neat, labeled boxes so the workers know exactly what to do.
  2. The Translator (Solver Agent):

    • Role: This agent takes the organized rules and translates them into a strict, computer-readable language called SMT-LIB. This is a language that logic machines understand perfectly, with no room for ambiguity.
    • Analogy: This is like a translator who converts a vague story into a precise mathematical equation.
  3. The Judge (Theorem Prover):

    • Role: This isn't an AI; it's a standard, off-the-shelf logic engine (like a super-fast calculator for logic). It takes the strict equations from the Translator and checks if they actually work.
    • Analogy: This is the strict math teacher who checks the homework. If the answer is wrong, the teacher doesn't just say "No"; they point out exactly where the logic failed.

The Secret Sauce: The Feedback Loop

The magic happens because these agents talk to each other in a loop:

  1. The Architect breaks down the puzzle.
  2. The Translator writes the rules in code.
  3. The Judge tries to solve it.
  4. If the Judge finds a mistake (e.g., "This code has a syntax error" or "This solution contradicts Clue #3"), it sends the work back to the Translator.
  5. The Translator fixes the mistake and tries again.
  6. They keep doing this until the Judge says, "This is perfect."

Think of it like a sculptor chipping away at a block of marble. If they hit a crack (an error), they adjust their chisel (the translation) and try again. They don't just guess; they refine their work based on immediate, hard facts.

The Results: A Massive Improvement

The authors tested this team approach on 114 different puzzles using three different AI models (GPT-4, GPT-3.5, and Llama3).

  • Before the team: GPT-4 solved about 24% of the puzzles correctly on its own.
  • After the team: With the help of the logic engine and the feedback loop, GPT-4 solved 63% of the puzzles correctly.
  • The Gain: That is a 166% improvement. It's like a student who used to get a D suddenly getting an A+ because they had a tutor and a strict grader helping them.

How They Checked the Work

To make sure their computer grading system was fair, they hired a group of human students to grade a sample of the puzzles. They compared the human grades to the computer's grades.

  • The Finding: The computer grader agreed with the humans almost all the time (over 85% of the time). This proved that their automated system was reliable and didn't need humans to check every single answer.

Summary

The paper shows that while AI is great at understanding language, it needs help with strict logic. By combining a "smart" AI (which understands the clues) with a "strict" logic machine (which checks the math) and letting them correct each other, they created a system that solves complex logic puzzles far better than the AI could do alone.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →