You upload a 50-page contract to ChatGPT and ask: "What are the termination clauses?" It gives you three bullet points — two of which are wrong. You try Claude. It misses the section entirely. You try DeepSeek. It invents a clause that doesn't exist.

The problem isn't your prompt. It's how you're feeding the document to the AI.

Most people upload raw PDFs and expect perfect results. But raw PDFs are full of binary noise, broken tables, and formatting artifacts that confuse every AI model — from ChatGPT and Claude to DeepSeek, Qwen, Gemini, and even the new GLM-5.2 with its massive 1M token context window.

This guide shows you exactly how to prepare documents and structure prompts to get accurate, reliable results from every major AI model.

Models Covered in This Guide

🇺🇸 ChatGPT (GPT-4o, o3) 🇺🇸 Claude (Opus 4.8, Sonnet 4.6) 🇨🇳 DeepSeek (V3, R1) 🇨🇳 GLM-5.2 (Zhipu AI) 🇨🇳 Qwen (Qwen3) 🇺🇸 Gemini (2.5 Pro) 🇨🇳 Kimi (Moonshot) 🇫🇷 Mistral (Large)

Step 1: Convert Your Document to Markdown (Before Anything Else)

This is the single most impactful thing you can do. Before you write a single prompt, convert your PDF to Markdown. Here's why:

  • 70% fewer tokens — a 28,000-token PDF becomes an 8,500-token Markdown file
  • Tables survive intact — PDF tables are visual; Markdown tables are structured data
  • Headings are semantic## Termination Clauses is unambiguous; large bold text is not
  • No binary noise — font files, positioning data, and rendering metadata are stripped

Use Inputo's free converter — upload your PDF, get clean Markdown in seconds. No signup, no limits.

Pro tip: Even if the AI model accepts PDF uploads (ChatGPT, Claude, Gemini all do), converting to Markdown first consistently produces more accurate results — especially for tables and structured data.

Step 2: Choose the Right Strategy for Document Length

How you feed the document depends on how long it is and which model you're using:

Document length Strategy Best models
1–5 pages Paste entire Markdown directly Any model
5–30 pages Paste relevant sections with context headers ChatGPT, Claude, DeepSeek, Qwen
30–200 pages Chunk by section, process iteratively Claude (200K), GLM-5.2 (1M), Gemini (1M)
200+ pages Full document only on 1M+ context models GLM-5.2 (1M), Gemini (1M+)

For Short Documents (1–5 Pages)

Paste the entire Markdown into the chat. Add a clear prompt at the end:

Here is a contract in Markdown format:

[paste Markdown]

Extract all termination clauses. For each clause, provide: (1) the clause number, (2) the conditions for termination, (3) the notice period required, and (4) any penalties. Format as a table.

For Medium Documents (5–30 Pages)

Don't paste the whole thing. Extract the relevant sections first, then paste them with section headers as context:

I'm going to share sections from a 20-page employment contract. Each section will be preceded by its heading for context.

## Section 4: Termination

[paste section]

## Section 7: Non-Compete

[paste section]

Based on these sections, summarize the employee's obligations if they resign within the first year.

For Long Documents (30–200 Pages)

Use a chunking strategy. Break the document into logical sections and process each one with a consistent prompt template:

You are analyzing a 100-page financial report. I will send you sections one at a time. For each section, extract: key metrics, year-over-year changes, and any risk factors mentioned.

After all sections are processed, I will ask you to produce a summary.

---

SECTION 1: Executive Summary

[paste section]

Then send subsequent sections with "SECTION 2:", "SECTION 3:", etc. At the end, ask for the consolidated analysis.

For Very Long Documents (200+ Pages)

Only two models can handle this in a single pass:

  • GLM-5.2 (Zhipu AI) — 1M token context, MIT-licensed, open-weight. Released June 2026, it's already being called "the ChatGPT moment for local AI." It outperforms Claude Opus 4.8 and GPT-5.5 on long-horizon coding tasks.
  • Gemini 2.5 Pro (Google) — 1M+ token context. Excellent for document analysis with its massive window.

For other models, you'll need the chunking strategy above, or you can use Markdown to reduce token usage enough to fit more content in context.

Step 3: Write Prompts That Prevent Hallucinations

The biggest risk when using documents with AI is hallucination — the model inventing information that isn't in the document. Here's how to prevent it:

The "Only From This Document" Rule

Always tell the model to use ONLY the provided document. This one sentence eliminates most hallucinations:

Answer based ONLY on the document provided below. If the information is not in the document, say "This information is not in the provided document." Do not use outside knowledge.

The "Quote Your Sources" Technique

Ask the model to quote the exact text it's basing each answer on:

For each answer, include the exact quote from the document that supports your response. Format: Answer: [your answer] | Source: "[exact quote from document]"

The "Confidence Score" Prompt

For critical documents (legal, financial, medical), ask for confidence levels:

Analyze this contract clause. For each point you extract, rate your confidence: HIGH (explicitly stated), MEDIUM (strongly implied), or LOW (inferred). Flag any LOW confidence items for human review.

Step 4: Model-Specific Optimization

🇺🇸 ChatGPT (GPT-4o, o3)

Strengths: Excellent at following structured prompts, good at table extraction from Markdown.

Weakness: Tends to summarize instead of extracting verbatim. Can miss details in long documents.

Optimization: Use "Do not summarize. Extract verbatim." in your prompt. For tables, specify the exact output format you want.

Extract all line items from this invoice. Do NOT summarize. Output as a Markdown table with columns: Item | Quantity | Unit Price | Total. Include every single row.

🇺🇸 Claude (Opus 4.8, Sonnet 4.6)

Strengths: 200K context window, excellent at nuanced analysis, follows complex instructions precisely.

Weakness: Can be overly verbose. Sometimes adds caveats instead of giving direct answers.

Optimization: Use explicit output format instructions. Claude responds well to XML-style tags for structuring input/output.

<document>

[paste Markdown]

</document>

<task>Extract all payment terms from the document above. Format: numbered list. Each item: [clause reference] — [terms]. Max 200 words total.</task>

🇨🇳 DeepSeek (V3, R1)

Strengths: Strong reasoning (especially R1), excellent with technical and structured content, free tier available.

Weakness: Can struggle with nuanced legal language. Sometimes prioritizes speed over accuracy.

Optimization: DeepSeek was trained heavily on GitHub and technical docs, so it handles Markdown exceptionally well. Use step-by-step prompts for complex analysis.

Analyze this technical specification step by step:

1. First, identify all performance requirements

2. Then, compare each requirement to the test results

3. Finally, list any requirements that are NOT met, with the specific shortfall

[paste Markdown]

🇨🇳 GLM-5.2 (Zhipu AI) — The New Contender

Strengths: 1M token context window (largest open-weight model), MIT licensed, outperforms Claude Opus 4.8 and GPT-5.5 on long-horizon tasks. Can process entire books in a single pass. Runs locally on a single Mac.

Weakness: Newer model — less community prompt engineering knowledge available. Coding-first design means it may need more guidance for creative writing tasks.

Optimization: GLM-5.2 shines with long documents. Its 1M context means you can paste entire reports without chunking. Use explicit reasoning prompts — it has selectable reasoning modes that activate deeper analysis.

You are analyzing a 200-page technical manual. The entire document is provided below in Markdown format.

[paste entire Markdown — GLM-5.2 can handle it]

Task: Create a comprehensive index of all safety warnings in this document. For each warning, provide: (1) section number, (2) severity level, (3) the warning text, (4) which equipment it applies to.

GLM-5.2 is available through Z.AI's GLM Coding Plan, OpenRouter, and can be self-hosted. It's MIT-licensed, so you can deploy it without restrictions. For document analysis, its 1M context window is a game-changer — no more chunking needed.

🇨🇳 Qwen (Qwen3)

Strengths: Excellent multilingual support (especially CJK languages), good at structured extraction.

Weakness: Smaller context window than GLM-5.2. Can struggle with very long documents.

Optimization: Qwen works best with explicit structure. Use numbered lists and tables in your prompts. For Chinese documents, Qwen outperforms Western models.

🇺🇸 Gemini 2.5 Pro (Google)

Strengths: 1M+ token context, excellent multimodal capabilities (can read images in PDFs directly).

Weakness: Sometimes overly cautious — may refuse to analyze certain document types.

Optimization: Gemini's massive context window means you can upload entire documents. Use Google AI Studio for the best experience with long documents.

🇨🇳 Kimi (Moonshot AI)

Strengths: Strong long-context capabilities, good at Chinese and English document analysis.

Weakness: Less known internationally — fewer prompt engineering resources available.

Optimization: Kimi responds well to structured prompts with clear output format specifications. Use Markdown input for best results.

🇫🇷 Mistral (Large)

Strengths: Efficient, good at European languages, strong reasoning.

Weakness: Smaller context window than competitors. Best for shorter documents.

Optimization: Keep prompts concise. Mistral works best with focused, specific questions rather than broad analysis requests.

Step 5: Advanced Techniques

The "Two-Pass" Method

For critical documents, use two passes:

  1. Pass 1 — Extraction: "Extract all key data points from this document into a structured table."
  2. Pass 2 — Verification: "Review the table below against the original document. Flag any discrepancies or missing data."

This catches errors that a single pass might miss.

The "Role" Technique

Assign a specific role to the AI for domain-specific documents:

You are a senior tax accountant with 20 years of experience in Spanish tax law. Analyze this tax return and identify any deductions the taxpayer may have missed. Reference specific line numbers from the document.

The "Chain of Thought" Prompt

For complex documents, force the model to think step by step:

Analyze this contract clause. Think step by step:

1. First, identify the parties involved

2. Then, identify the obligation being described

3. Then, identify any conditions or triggers

4. Finally, identify the consequences if the obligation is not met

Show your reasoning for each step.

Document Comparison Across Models

For high-stakes documents, run the same prompt across multiple models and compare results. Discrepancies highlight areas that need human review:

Use case Best model Why
Contract analysis Claude Opus 4.8 Best at nuanced legal language
Financial reports GPT-4o Excellent at numerical extraction
Technical manuals (full) GLM-5.2 1M context — reads entire manual at once
Chinese documents Qwen3 Best CJK language support
Scanned documents Gemini 2.5 Pro Native image/multimodal processing
Budget analysis DeepSeek R1 Strong reasoning, free tier
European legal docs Mistral Large Strong in FR/DE/IT/ES languages
Long Chinese reports Kimi Long context + excellent Chinese

Common Mistakes (And How to Avoid Them)

❌ Uploading Raw PDFs

The fix: Always convert to Markdown first. Use Inputo's free converter.

❌ Sending the Entire Document When You Need One Section

The fix: Extract and paste only the relevant sections. This saves tokens and improves accuracy.

❌ Vague Prompts

❌ "Summarize this document."

✅ "Extract the 3 most important financial metrics from this report. For each, provide: metric name, current value, previous period value, and percentage change."

❌ Not Specifying Output Format

❌ "What are the key points?"

✅ "List the key points as a numbered list. Each point: max 2 sentences. Include the page/section reference for each."

❌ Trusting the First Output

The fix: Always verify critical data points against the source document. Use the two-pass method for high-stakes analysis.

The Bottom Line

Getting great results from AI with documents isn't about which model you use — it's about how you prepare the document and structure your prompt. The three rules:

  1. Convert to Markdown first — saves tokens, preserves structure, prevents hallucinations
  2. Be specific — tell the model exactly what to extract and how to format it
  3. Verify — always check AI output against the source document for critical data

Whether you're using ChatGPT, Claude, DeepSeek, the new GLM-5.2, Qwen, Gemini, or any other model — these principles work across all of them.

Start with the Right Format — Free

Convert your PDF to Markdown in seconds. No signup, no limits, no watermark. Works with every AI model.

Convert PDF to Markdown →

Further reading: Free PDF to Markdown Converter for Every AI · Why Markdown Is the Best Format for AI