Prompting technique

Structured Prompting with Negative Constraints

ARETE: an R package for Automated REtrieval from TExt with large language models, arXiv:2511.04573 (2025) · read the paper

What it does

A method of structured prompting with negative constraints for extracting data from text. The prompt consists of four layers: output format, positive rules (what to include), negative constraints (what to exclude), and edge case handling. Increases accuracy from 60% to 80%+ by explicitly forbidding the addition of non-existent information.

Task typeextraction
Shapesingle shot
Efforttwo or three steps
Addressesanswers that are close but wrong; invented facts and citations; output that ignores the requested format
Published2025-11-06
AuthorsVasco V. Branco, Jandó Benedek, Lidia Pivovarova et al.

When it helps

Use this technique when you need to extract structured data from large volumes of unstructured text with high accuracy. Especially effective for scientific articles, reports, reviews, legal documents where accuracy and absence of extra information is important. Apply when basic prompts give too much 'creativity' from LLM — the model adds data that isn't in the text, or includes irrelevant information. The method is critical for creating databases, organizing archives

A prompt you can paste

Generic by design: it applies the technique without knowing your task. Adapt the marked parts.

Prompt
### Role and Task
You are an expert data analyst. Your task is to analyze the provided text and extract specific information according to the defined structure.

### Output Format
Respond **SOLELY** in a Markdown table with the following columns:
- `Placeholder 1`
- `Placeholder 2`
- `Placeholder 3`

### Instructions and Constraints
1.  **What to include:**
    *   Include all data points that match the defined criteria for each column.
    *   If a specific data point is not found for a column, leave the cell empty.

2.  **What NOT to include (CRITICAL):**
    *   **DO NOT** include any information that does not directly correspond to the defined columns.
    *   **DO NOT** include any introductory phrases, greetings, summaries, or concluding remarks.
    *   **DO NOT** include duplicate entries if the same information appears multiple times.

### Text for Analysis
[Insert text for analysis here]

If this one does not fit, the two closest alternatives in the corpus are Layered Context Prompting and Prompt-based Extraction (Cloze Prompting with Verbalizer), which target the same failure from a different angle.

Worked example

The same technique applied to a concrete job: pull structured fields out of inconsistent invoices. Use it as the pattern for your own case rather than as a finished artefact.

Worked example
### Role and Task
You are an expert data extraction specialist. Your task is to analyze the provided invoice texts and extract specific, structured information.

### Output Format
Respond **ONLY** with a Markdown table containing the following columns:
- `Invoice Number`
- `Invoice Date`
- `Vendor Name`
- `Total Amount`
- `Line Item Description`
- `Line Item Quantity`
- `Line Item Unit Price`
- `Line Item Total`

### Instructions and Constraints
1.  **What to include:**
    *   Extract data for all identifiable invoices within the provided text.
    *   For each invoice, include all line items that are clearly listed.
    *   If a specific field (e.g., `Invoice Date`, `Total Amount`) is missing for an invoice, leave the corresponding cell in the table blank.
    *   For line items, if quantity or unit price is not explicitly stated but the line item total is present, infer the missing value if logically possible (e.g., Total = Quantity * Unit Price). If inference is not possible, leave blank.
    *   Include descriptions for line items as written in the text.

2.  **What NOT to include (CRITICAL):**
    *   **DO NOT** include any introductory or concluding text, greetings, or summaries. Your entire response must be the Markdown table.
    *   **DO NOT** include information from sections that are clearly not part of an invoice (e.g., general company contact information not tied to a specific invoice, payment terms not associated with a particular invoice number).
    *   **DO NOT** include details about previous invoices or future payment schedules unless they are part of the current invoice's itemized list.
    *   **DO NOT** include taxes, discounts, or shipping costs as separate line items unless they are explicitly itemized as such with a description and amount. If they are part of the `Total Amount`, they should not be broken out further unless detailed.

### Text for Analysis
[Paste the inconsistent invoice texts here.]

Get this written for your actual task

Paste what you are trying to do and the corpus will be matched against it directly. Free, no account, about ten seconds.

Free · no signup · ~10s
0.00match confidence
single retrieval pass
Prompt for your task

      

That number is low on purpose, and it is real. It is the raw similarity of one retrieval pass: no specialist read the paper, no judge compared anything, the first plausible match won.

6,235techniques in the corpus
one of which is this page

Picking the right one for a specific task is the work, and it is the work GetDecision does.

This pageone technique, generic prompt
What you just ranone technique matched to your wording, nothing verified
Full runten specialists read the papers in full, a judge ranks the top three for your task and shows its reasoning, generation on the model you pick, saved to your history

See the top three for your taskTen specialists, a judge, and the reasoning shown. Free account, first run included.

Run the full analysis

Related techniques

Layered Context PromptingLayer-by-layer enrichment of the prompt with context with clear division into logical blocks: TASK + FORMAT + …Prompt-based Extraction (Cloze Prompting with Verbalizer)The method transforms a classification task into fill-in-the-blank: text is inserted into a template with a [M…Requirement-Oriented Prompt Engineering (ROPE)ROPE (Requirement-Oriented Prompt Engineering) is an approach to creating prompts as detailed technical specif…Rebuttal PromptingRebuttal Prompting — a technique for correcting LLM errors through direct indication of inaccuracy. A simple r…

All techniques · Failure modes and fixes