I need to find duplicates of a requirements document. I have read through the list and I have used Copilot to scan through the list. Unfortunately, I received a lot of duplicated requirements even in the copilot output. How could I best address this such that the Copilot would not give me duplicated results?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Below are three complementary ways to keep Copilot (or any LLM‐based assistant) from spitting the same requirement back at you multiple times.
Pick the level of effort that fits your situation:
“Cheap & Cheerful” – Prompt-tuning only
────────────────────────────────────────────────────────
The quickest fix is to tighten the instructions you give Copilot and add some guard-rails inside the prompt itself.
Example prompt skeleton
code
You are a requirements analyst.
Task: From the list between the === delimiters, produce ONE de-duplicated list.
Rules
• A duplicate = any requirement that has the same intent or ≥ 80 % word overlap.
• Keep ONLY the first occurrence; drop the rest.
• Return the result as a numbered Markdown list.
• If two requirements are very similar but not identical, merge them into a single, clearer sentence.
• Do not invent new requirements.
===
<--- paste raw list here — one requirement per line --->
===
Why it helps
• Explicit criteria (“same intent or ≥ 80 % word overlap”) gives Copilot an objective test.
• “Keep only the first occurrence” forces it to decide, not hedge.
• A delimiter block keeps the model from mixing your instructions with your data.
Tip Chunk the input (e.g., 100 lines at a time). Large lists can exceed the model’s context window, causing it to “forget” earlier items and re-emit them.
────────────────────────────────────────────────────────
2. “Better Safe Than Sorry” – Check Copilot’s answer in Excel/Sheets
────────────────────────────────────────────────────────
After Copilot gives you its “unique” list, paste it into Excel.
Use Data ▶ Remove Duplicates (or UNIQUE() in Sheets) to see what it still flags.
If rows disappear, Copilot missed something; tighten the prompt or reduce chunk size.
You can close the loop in one pass by adding this to the end of the prompt:
code
After producing the list, output a final line:
"VERIFY-COUNT: <original_count> → <deduped_count>".
Now you can eyeball whether the reduction looks plausible before pasting into Excel.
────────────────────────────────────────────────────────
3. “Bullet-proof” – Local script + Copilot for only the fuzzy bits
────────────────────────────────────────────────────────
When the list is gigantic or contains many near-duplicates (“login”, “log-in”, “sign in” …) use code to do first-pass filtering and let the LLM adjudicate only the tricky ones.
Python starter snippet
python
import pandas as pd
from rapidfuzz import fuzz, process
df = pd.read_csv('requirements.csv', header=None, names=['req'])
# 1. Exact de-dupe
df = df.drop_duplicates(subset='req')
# 2. Near-duplicate clustering
unique_reqs = []
for req in df['req']:
# change threshold as needed
match, score, _ = process.extractOne(req, unique_reqs, scorer=fuzz.token_sort_ratio)
if score is None or score < 85:
unique_reqs.append(req)
pd.Series(unique_reqs).to_csv('unique_reqs.csv', index=False, header=False)
Feed only the borderline clusters (score 70-85) to Copilot with a prompt like:
code
Here are 5 requirements that might be duplicates.
Merge them into the minimum number of clear, unique requirements; preserve all key details.
────────────────────────────────────────────────────────
Key Takeaways
────────────────────────────────────────────────────────
• Copilot repeats itself mainly when the prompt’s success criteria are vague or the context window is over-filled.
• A crisp definition of “duplicate,” explicit removal/merge rules, and chunked input usually do the trick.
• For mission-critical specs, pair Copilot with a deterministic tool (Excel, Python, Power Query) so you have a verifiable audit trail.
Give one of the approaches a spin—start with the beefed-up prompt (#1). If you still see echoes, move to #2 or #3, and you’ll have a clean requirement set in short order.