Fixing AI Citation Errors
2025-07-183 turns8,800 charsgpt-4-1-mini, gpt-4o⑂ 1 fork(s)
Summary
User seeks solutions for AI-generated fake sources and broken links when researching topics on Perplexity.
Messages
⑂ thread forked here
Every AI ive tried (o3, gpt, gemini pro, etc) on Perplexity has this problem : When i ask it to research or find sources on a topic, it will use fake sources and give me broken or incorrect links. This happens even if i try to tell it to use "verifiable sources only". Some AIs are better or worse at this, for example, Kimi K2 makes really wild claims and refuses to admit the possibility it might be wrong till you ask for a direct page number.
Is there a way to get an AI to stop doing this?Interesting.
I imagine you could create an agentic workflow to compare the link with the point it is trying to make, maybe it is because it is only getting the llm.txt or whatever they store what to help LLMs scrape when they reference websites, they have robots.txt for scrapers to understand what they can access so I would imagine that if they do not have the llm.txt or not well structured or it is not relevant to the actual content of the link then it would provide false returns for when teh LLM is doing a tool use and returning content from a web source.
Maybe if instruct it specifically to analyze the full content of the page before inferring the relevance to the task it is accomplishing.
So something like:
You're onto something important, and this issue touches on *how LLMs handle retrieval* and the limits of their web-browsing or API-based tools.
### 🚨 The Problem
LLMs often **hallucinate citations** or **misrepresent web content** when doing tool use. Here’s *why*:
1. **Link stuffing without parsing**: Many retrieval-augmented generation (RAG) pipelines just **grab snippets or metadata**, not the full page content, and return it alongside a hallucinated explanation. The LLM isn’t actually *reading* the full page unless explicitly instructed to.
2. **Mismatch between snippet and claim**: Even if the LLM gets a chunk from the page, it often **doesn’t verify** that the chunk *actually supports the claim it makes*. It just *assumes* relevance.
3. **Model bias to “sound confident”**: Some models (like Kimi or Gemini) are tuned to be persuasive and assertive, even when wrong. They try to "connect the dots" creatively unless tightly constrained.
4. **Robots.txt & llm.txt**: You’re 100% right—`robots.txt` governs what crawlers see, and some companies are now proposing `llm.txt` to indicate AI-friendly or restricted areas. If the content is inaccessible or the AI fetch tool is working off summaries or search engine previews, **it’s not getting the real deal**.
---
### ✅ How to Get Better Results
You need to explicitly force the LLM to **verify** before asserting. Here's a refined prompt template:
---
**Prompt to force verification:**
> You are an assistant that uses retrieved web content, but you are NOT allowed to cite or make claims unless:
> 1. You have retrieved the full page content.
> 2. You’ve analyzed the full page and verified that the claim is directly supported.
> 3. You include an exact quote or summary with context from that page.
>
> Your task is to: **[INSERT QUERY]**
>
> For each source:
> - Check whether it is accessible and parseable.
> - Show a snippet of the actual retrieved content.
> - Compare that to your conclusion.
> - If there is no relevant support, say so.
---
### 🧠 If You’re Building Your Own Agentic System
You could build an LLM-based agent that:
1. **Retrieves web content with a headless browser** or `requests`/`BeautifulSoup`.
2. **Chunks the page**, stores it in a vector DB.
3. **Uses a verifier model or step** to:
- Compare the retrieved page’s actual language with the LLM’s claim.
- Reject hallucinations unless there is a **semantic match** or a **quote + surrounding context**.
This is essentially a **fact-checking agent** layered on top of your LLM.
You might find this flow useful:
```
[User Query] → [Search Tool] → [Scrape Full Page] → [Chunk & Embed] →
[Relevance Rank] → [Claim Generator] → [Verifier] → [Return or Reject]
```
---
### 🛠️ Tools You Can Use
- **Web scraping & page rendering**: `Playwright`, `Selenium`, `requests-html`
- **Verification agent**: A separate prompt like “Does this quote from [Page X] directly support Claim Y?”
- **Embedding + Retrieval**: `LangChain`, `LlamaIndex`, `ChromaDB`
---
### Bonus: An Instructive Analogy
Think of a lawyer who says, “According to Article 5 Section 2...” but never actually opened the lawbook. That’s what most LLMs do *unless* you make them do this:
> “Open the book, read the whole article, and point out *exactly* which sentence backs your claim.”
Otherwise, they’re quoting from memory + vibes.
---
If you'd like, I can help you prototype a prompt template or build a simple verifier workflow using local models or OpenAI APIs. Just say the word.
gpt-4o
Yeah, this is a really common and tricky problem with current LLMs, especially those trying to generate citations or “source” links on the fly. The core issue is that most LLMs **do not actually “browse” or verify live webpages** — they generate plausible-sounding URLs and references based on patterns learned during training, which leads to made-up or broken links.
Your idea to have an agentic workflow that **validates the link content against the claim** is definitely the right approach. Here’s how you could think about it, or build a system to reduce hallucinated or fake sources:
---
### 1. **Step 1: Source Discovery**
- When the AI needs to find sources, have it generate **candidate URLs** or document references.
- Then, automatically fetch the **full HTML/text content** of those URLs (i.e., a real web scrape or API call).
### 2. **Step 2: Content Validation**
- Use a tool or LLM to analyze the **actual content** of each fetched page.
- Extract key facts or relevant passages that support the claim.
- Cross-check the facts against the AI’s original statement.
### 3. **Step 3: Link Verification**
- Confirm that the **page exists** (status code 200).
- Confirm the **content is relevant** — not a dead page, unrelated page, or paywall.
- If relevance or accessibility is low, discard or flag the source.
### 4. **Step 4: Final Source Selection**
- Only include links in the answer if they **pass the above verification**.
- Otherwise, say “I couldn’t find a verifiable source for this,” or suggest more searching.
---
### How to operationalize this?
- **Use an external retrieval + validation agent:**
Combine a retrieval system that does live web scraping or API queries (like Bing search API, Google Search API, or open datasets) with an LLM that can summarize and verify the retrieved content.
- **Chain of Thought + Tool Use:**
Prompt the LLM to reason step-by-step about whether a source supports a claim, asking it to quote exact passages, then only return the source if the passage is sufficiently relevant.
- **Use a multi-agent setup:**
One agent fetches URLs, another agent reads and verifies content, and a third agent compiles the final answer with validated references.
---
### Why do many current AIs fail at this?
- They **don’t do real-time browsing or scraping** but generate plausible references from training data.
- Training data or retrieval corpora are incomplete or stale.
- Lack of feedback loops that check if URLs are valid or relevant.
- They may not access “robots.txt” or “llm.txt” properly to understand what content is scrapeable or reliable.
- Sometimes the system designers prioritize speed or cost over thorough validation.
---
### What you can do as a user?
- Explicitly request for answers **without invented URLs**, or “only from known trusted databases.”
- Ask for **direct quotes or passages** instead of just links.
- Use tools or bots designed for **real-time browsing with verification**, such as OpenAI’s browsing-enabled models or Microsoft Bing chat.
- Use an **agent-based workflow** you build or that others have built — tools like LangChain, AutoGPT, or n8n workflows that combine retrieval + validation + answer synthesis.
---
### Summary prompt example you could try with a powerful LLM or agent:
```
You are an AI researcher assistant tasked with answering a question using only verifiable, authoritative sources.
1. Search for relevant sources online using live web search.
2. For each candidate URL, fetch and read the full content.
3. Verify if the page content supports the claim or information you want to provide.
4. Discard any sources with broken links, irrelevant content, or paywalls.
5. Summarize the verified content in your answer.
6. Provide the exact URL only if the content matches your summary.
If no verified source is found, say so instead of inventing links.
```
---
Would you like help building an agentic workflow or example code to implement this? Or tips on setting up reliable retrieval + validation chains with existing LLM APIs?
gpt-4-1-mini