Classifier or Prompt: A Case Study on Legal Requirements Traceability
This paper evaluates automated solutions for legal requirements traceability, demonstrating that a specialized prompt-engineered LLM (RICE_LRT) and a semantic similarity classifier (Kashif) significantly outperform existing baseline methods in identifying trace links between technical requirements and legal regulations like the GDPR.
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
The Big Problem: The "Lost in Translation" Game
Imagine you are building a new app, like a ride-sharing service called WeMobilize. You have a team of engineers who write the "rules" for how the app should work (e.g., "Users must be able to delete their accounts").
Now, imagine there is a massive, complex rulebook written by the government called GDPR (a law about protecting people's private data). This rulebook is written in "Legalese"—a very formal, specific, and often vague language.
The Challenge:
Your engineers need to make sure every single rule in their app matches a rule in the government's book. If they miss one, the company could get fined millions of dollars.
- The Problem: The engineers speak "Tech," and the law speaks "Law." They don't use the same words.
- Engineer says: "I want to stop getting emails."
- Law says: "The data subject has the right to withdraw consent."
- The Old Way: Humans have to read thousands of lines of code and thousands of lines of law, trying to guess which ones match. It's like trying to find a specific needle in a haystack while wearing blindfolded. It takes forever and is prone to mistakes.
The Solution: Two Digital Assistants
The authors of this paper built two different "AI assistants" to help humans find these matches automatically. They tested them to see which one was better.
Assistant #1: Kashif (The "Super-Translator")
How it works:
Think of Kashif as a highly trained librarian who has read millions of books. It uses a technology called "Sentence Transformers."
- Instead of just matching words (like "delete" matching "delete"), Kashif understands the meaning of the sentence.
- It takes an engineer's requirement and a law, turns them into "mathematical shapes" (vectors), and sees how close those shapes are to each other.
- The Analogy: If you ask a normal computer, "Do 'apple' and 'fruit' match?" it might say "No" because the letters are different. Kashif understands that an apple is a fruit, so it says, "Yes, they are very close."
The Result:
Kashif was great at the "easy" test (using a dataset called HIPAA). It found about 63% of the correct matches, beating all the old methods by a huge margin.
- The Catch: When the test got harder (using the complex GDPR rules), Kashif got confused. It only found 15% of the matches. It was like a librarian who is great at organizing fiction books but gets lost when you ask them about complex legal contracts.
Assistant #2: Rice LRT (The "Expert Consultant")
How it works:
This assistant uses a Large Language Model (LLM), like the advanced AI behind tools such as ChatGPT (specifically GPT-4o).
- Instead of just calculating math, the researchers gave the AI a very specific "job description" (a prompt).
- They told the AI: "You are a legal expert. Here are 5 examples of how to match a rule to a law. Now, look at this new rule and tell me which laws it breaks, and explain why."
- The Analogy: If Kashif is a librarian who sorts books by color, Rice LRT is a senior lawyer you hire for a consultation. You give them a few examples of your past cases, and they use their reasoning skills to figure out the new case.
The Result:
Rice LRT was a superstar. On the hard GDPR test, it found 84% of the correct matches.
- It didn't just say "Yes/No." It gave a rationale (a reason).
- AI says: "This requirement matches the 'Right to Access' law because the user needs a key file to unlock the database, which is a form of authentication."
- This helped humans trust the AI and fix the few mistakes it made.
The Showdown: Who Won?
The researchers ran a race between these two assistants and several older, slower methods.
- The Old Guard (The Baselines): These were the "dumb" computers from the past (like simple word-counting machines). They performed terribly, often finding less than 20% of the matches. They couldn't understand the difference between "Tech" and "Law."
- Kashif (The Classifier): It was the runner-up. It was fast and good at simple tasks, but it struggled when the rules got too complex or the vocabulary was too different.
- Rice LRT (The Prompted LLM): It won the race. By using a smart "prompt" (a set of instructions), it understood the nuance of the law better than anything else.
Why This Matters to You
You might think, "I'm not a lawyer or a coder, why do I care?"
- Safety & Privacy: This research helps companies build apps that actually protect your data. If the AI can't find the link between your app's features and the privacy laws, your data might be leaked, and the company might get fined.
- Speed: Instead of a team of lawyers spending months checking an app, an AI can do the heavy lifting in minutes, leaving the humans to just double-check the final list.
- The Future: The paper shows that while "smart math" (Kashif) is good, "smart reasoning" (Rice LRT) is even better for complex legal problems. It proves that we need to teach AI not just to calculate, but to think like a legal expert.
The Bottom Line
The paper concludes that to keep software safe and legal, we can't just use old-school computer tricks. We need to use advanced AI that understands the spirit of the law, not just the words. The "Rice LRT" method, which acts like a smart consultant, is currently the best tool we have for this job.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.