Soft2Soft AI Practical knowledge base
Промпт-инжиниринг

How to Write a Prompt for Document Analysis Without Fabricated Facts

16 views
промпты анализ документов нейросети

How to Write a Prompt for Document Analysis Without Fabricated Facts

When analyzing a contract, report, manual, or correspondence, an AI model may fill in missing information with plausible guesses. To get a verifiable result, simply asking it to “analyze the text” is not enough. The prompt must define the source, the limits of acceptable inferences, the evidence format, and the procedure to follow when information is missing.

Why a General Request Produces an Inaccurate Answer

The phrase “read the document and find problems” gives the model too much freedom. It does not know whether it may use general knowledge, whether it must quote the source, or how it should flag contradictions. A reliable prompt separates four levels:

  • facts explicitly stated in the text;
  • conclusions that logically follow from those facts;
  • ambiguities and contradictions;
  • information that is absent from the document.

Step 1. Define a Specific Task

Start with the required result. Instead of saying “analyze the contract,” specify what must be found: deadlines, penalties, the parties’ obligations, termination conditions, or additional costs.

Weak wording:

Analyze the contract and find problems.

More specific wording:

Find the following in the contract:
1. work completion deadlines;
2. payment terms;
3. grounds for termination;
4. fines and penalties;
5. customer obligations that may cause additional costs.

The list of questions also serves as a checklist for assessing the completeness of the answer.

Step 2. Restrict the Information Source

If the analysis must rely only on the provided document, state this explicitly. This restriction is especially important for legal, financial, medical, and technical texts.

Use only the information from the text below.
Do not add facts, dates, or terms that are not present in the document.
If the answer is unavailable, write: “Not specified in the document.”

When external context is needed, allow it in a separate section:

First, answer using only the document.
Then separately list general observations that are not stated in the text.
Do not mix these two types of information.

Step 3. Require Evidence for Every Conclusion

A practical way to reduce fabricated information is to require the model to show the basis for each statement. For every risk or conclusion, request a short excerpt, a clause number, or the opening words of the relevant paragraph.

For each conclusion, provide:
- a brief answer;
- a supporting excerpt;
- the section or clause;
- a confidence level: high, medium, or low.

If no supporting evidence is available, the conclusion should be marked as unconfirmed rather than stated categorically.

Step 4. Separate Facts from Assumptions

The model may notice an ambiguity but present a possible interpretation as an established fact. Define labels for different types of statements in advance.

LabelMeaningWhen to Use It
FactExplicitly stated in the documentAn exact statement is present
ConclusionFollows from several provisionsThe connection can be explained using the text
AssumptionA possible interpretationThere is insufficient information
Not specifiedNo information is providedThe document does not answer the question
Do not present an assumption as a fact.
Label every statement as “Fact,” “Conclusion,” “Assumption,” or “Not specified.”

Step 5. Define the Response Structure

A free-form response is difficult to verify. When looking for risks and omissions, it is better to use a table with fixed columns.

Return the result as a table:
Question | Answer based on the document | Statement type | Evidence | Location in the text | What needs clarification

For a large document, first request a map of its sections and then analyze only the relevant parts. This helps prevent important conditions from being lost among secondary details.

Step 6. Add a Self-Check

After producing the main answer, the model should review its own result. This does not guarantee complete accuracy, but it can help identify unsupported statements and unanswered questions.

After the analysis, check:
- whether any conclusions lack a supporting excerpt;
- whether every question has been answered;
- whether any dates, amounts, or parties have been confused;
- whether sections of the document contradict one another;
- which points must be reviewed by a person.

Universal Prompt Template

Task: analyze the document and answer the questions.
Source:
Use only the document text. Do not add information from memory or external sources.
Questions:


[question 1]


[question 2]


[question 3]


Rules:


separate facts from conclusions and assumptions;


if information is missing, write “Not specified in the document”;


provide a supporting excerpt for every answer;


identify the section, clause, or opening words of the paragraph;


flag contradictions between different parts of the text;


do not correct or supplement the document without a separate label.


Format:
Question | Answer | Statement type | Evidence | Location in the document | What needs clarification
Self-check:
List answers that lack sufficient evidence and questions that the document does not answer.
Document:
[PASTE THE TEXT HERE]

Example: Reviewing a Technical Specification

Suppose you need to determine whether there is enough information to estimate development work. Do not immediately ask for a price estimate. First, check whether the source requirements are complete.

Review the technical specification for completeness for cost estimation.
Find:


the list of features;


design requirements;


integrations;


user roles;


security requirements;


acceptance criteria;


deadlines;


technology constraints.


Use only the specification text.
For each item, state: “fully described,” “partially described,” or “not specified.”
Provide a supporting excerpt.
At the end, prepare questions for the customer, but do not invent answers.

This type of request reveals unknown parameters before estimation and does not conceal them behind guesses.

Example: Analyzing Correspondence

Correspondence can reveal promises, deadlines, and unresolved issues, but participants’ motives must not be inferred without direct evidence.

Analyze the correspondence using only its contents.
Identify:


who promised what;


the stated deadlines;


completed actions;


unresolved issues;


contradictory messages.


Do not draw conclusions about the participants’ motives, personalities, or emotions.
For each item, provide an excerpt from the message and the date, if available.

How to Verify the Result Manually

  1. Select the three most important conclusions and find supporting evidence for each one in the source.
  2. Verify dates, amounts, percentages, titles, and names.
  3. Check whether the word “may” has been turned into a categorical statement.
  4. Make sure missing information is marked as “not specified” rather than filled with guesses.
  5. Analyze disputed points separately by providing only the relevant excerpt.

Common Mistakes

  • The task is too broad. The model decides for itself what should be considered important.
  • The source is not restricted. The answer includes information that is not present in the document.
  • No evidence is required. Conclusions are difficult to verify.
  • The format is undefined. Facts, recommendations, and assumptions become mixed together.
  • There is no rule for missing information. Absent details are replaced with plausible additions.
  • A solution is requested immediately. It is better to extract the facts first and request recommendations separately afterward.

Final Checklist

  • The task is divided into specific questions.
  • The prompt states whether external knowledge may be used.
  • Evidence is required for every conclusion.
  • Facts are separated from assumptions.
  • The response to missing information is defined.
  • A verifiable output format is specified.
  • A final self-check is included.

A good document-analysis prompt creates a procedure in which every important conclusion is linked to its source, while gaps and uncertainties remain visible. This makes the result easier to verify, discuss, and use in subsequent work.