Apply to my task
arXiv:2603.23482 ★ 83 Mar 24, 2026

PEGS Prompting: Split an Extraction Task into 4 Categories and Get the Full Picture Instead of Half

Key result

With a general 'extract all the requirements' request, the model catches about 60% of what's there — the rest sinks. It looks for things that 'resemble a requirement' and latches onto explicit technical specs. PEGS prompting lets you break down any long document without gaps: instead of one fuzzy request, four hard angles with clear boundaries. The aim narrows — the model goes through each dimension separately instead of guessing what to look for in the first place. Coverage from 61% to 92% — no fine-tuning, one prompt.

01

TL;DR

Ask a model to "extract all the requirements from this document" and it fixates on the obvious and misses what's hidden. PEGS prompting fixes this structurally: instead of one general request, you give it four specific angles of analysis — Project, Environment, Goals, System. The model doesn't guess what to look for; it walks through the given categories one by one.

The main finding: models tend to "lock onto" the obvious requirements and cluster in one zone. With a general "extract the requirements" request, ~60% of the categories in the document go uncovered. The model focuses on explicit technical specs and ignores context (who the client is, what external constraints exist, what goals sit behind the task).

PEGS prompting switches the model from "look for things that resemble a requirement" mode to "walk through four clear dimensions" mode. Each dimension is a separate, narrowly targeted request with a clear semantic boundary. Category coverage climbs from 61% to 92% — practically no blind spots left.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

Works in a single prompt with four lens sections:

LENS 1: Project (P) → stakeholders, budget, timeline, organizational context
LENS 2: Environment (E) → external systems, regulatory requirements, operating conditions
LENS 3: Goals (G) → business goals, success criteria, user expectations
LENS 4: System (S) → functional requirements, non-functional ones (speed, security, reliability)

Each lens gives the model a concrete search target. Not "find everything", but "find this specific thing".

03

Example in Practice

Task: A freelancer gets a brief from a client — a startup wants to launch a service for managing employee business travel. The document is 4 pages long and written all over the place. You need to figure out what you're actually supposed to build.

Prompt:

Here is a client brief. Analyze it across four categories — go through each one separately 
and don't move on to the next until you've finished the current one.

CATEGORY P — PROJECT:
Who is the client and what kind of company is it? Who are the users? What are the constraints: budget, timeline, 
team? What organizational factors need to be considered?

CATEGORY E — ENVIRONMENT:
Which external systems need integration (accounting, flight booking, banks)? 
What regulatory or legal requirements are mentioned? What operating conditions 
(mobile devices, offline mode)?

CATEGORY G — GOALS:
What business goals are behind the product? What counts as success? What does 
the user ultimately want to get? What pain points are we solving?

CATEGORY S — SYSTEM:
What exactly must the system do (features)? What are the non-functional requirements 
(speed, security, scale, reliability)?

In each category: list your findings. After all four, point out which 
requirements overlap or contradict each other.

BRIEF:
[paste the brief text]

Result: The model will go through all four sections in order, each with a structured list. Section G will surface things the brief never states explicitly — the model will infer them from context. Section E will catch integrations and constraints the client never named outright. At the end you get a list of contradictions to clarify on a call. One chaotic document turns into a four-block structure that's ready for estimating.

04

Why It Works

The model's weakness: an LLM generates text along the most probable pattern. Ask it to "find the requirements" and it produces what looks like typical requirements: explicit technical specs. Implicit constraints, business context, external dependencies look different, and the model doesn't "see" them as requirements.

The model's strength: on the other hand, it works well with a tightly bounded search space. When the prompt says "look only at regulatory and operational constraints", the model literally narrows its search and finds what was drowning under the broad request.

How the method uses this: PEGS turns one complex, fuzzy request into four narrow, targeted ones. Each category is its own context with clear examples of what belongs there. The model doesn't guess — it follows a route.

Control levers: - Add examples inside a category — after the category name write "for example: response-time requirement, load requirement". This gives the model a pattern to work from - Add a "Risks" category — the four PEGS categories can be extended with a fifth one for your task - Change the output format — instead of a list, ask for a table with columns "Requirement / Priority / Source in the document" - Add a conflict check — "after all the categories, list the contradictions" — that's built-in verification

05

Prompt Template

Analyze the {document/text/brief} across four categories. 
Go through each category separately and completely before moving on to the next.

CATEGORY P — PROJECT:
Who is involved? What organizational constraints exist (timeline, budget, team)? 
What context matters for understanding the task?

CATEGORY E — ENVIRONMENT:
Which external systems, services, tools are involved or mentioned?
What regulatory, legal or operational constraints are there?

CATEGORY G — GOALS:
What business goals are behind the task? What counts as success?
What should the user or client ultimately get?

CATEGORY S — SYSTEM:
What specifically must it do (features)?
What non-functional requirements: speed, security, reliability, scale?

For each category: {format — list / table / paragraphs}.
At the end: point out overlaps and contradictions between categories.

{document/text}

Placeholders: - {document/text/brief} → what we're analyzing: a spec, a contract, a project description, a client email - {format} → how to present the result: list, table, numbering


🚀 Quick start — paste into the chat:

Here is a PEGS prompting template. Adapt it to my task: [your task].
Ask me questions to fill in the fields.

[paste the template above]

The LLM will ask what to analyze and what format you need the result in — because the method adapts to any document type and any desired output format. It will take the four-category structure and tune it to your task.

06

Limitations

⚠️ Short, simple texts: For a one-paragraph email or a simple request, PEGS is overkill — some categories will come out empty. The method shines on long, multi-part documents.

⚠️ The "Environment" category is the hardest: External constraints and regulatory context are often written as background text rather than explicit requirements. The model misses them more often than other categories — even with PEGS. It's worth running this section through a separate follow-up request.

⚠️ Implicit requirements via references: If the document references another standard or document ("must comply with ISO/IEC 27001"), the model doesn't know that document's contents and won't pull out the requirements hidden there.

⚠️ The method is built for documents: It works well for analyzing texts. For creative, subjective or open-ended tasks, the four-category structure doesn't fit.

07

Resources

Paper: ReqFusion: A Multi-Provider Framework for Automated PEGS Analysis Across Software Domains

PEGS methodology: Bertrand Meyer, the original Project-Environment-Goals-System framework

Authors: Muhammad Khalid, Manuel Oriol, Yilmaz Uygun — Constructor University Bremen, Germany

System demo: https://re-engineer-app-khalid.replit.app

Research digest

Key result

With a general 'extract all the requirements' request, the model catches about 60% of what's there — the rest sinks. It looks for things that 'resemble a requirement' and latches onto explicit technical specs. PEGS prompting lets you break down any long document without gaps: instead of one fuzzy request, four hard angles with clear boundaries. The aim narrows — the model goes through each dimension separately instead of guessing what to look for in the first place. Coverage from 61% to 92% — no fine-tuning, one prompt.

Principle

One broad request — the model looks for the most probable 'requirements' — misses context, constraints, goals. Four narrow requests — the model walks each dimension in turn — nothing sinks. The categories work like a route: Project (who the client is, timeline, team), Environment (external systems, regulatory constraints), Goals (business objectives, success criteria), System (features, speed, security). Each category is its own context with clear examples of what belongs in it. The model knows where to look — and goes there.

Why it works

The model generates along the most probable pattern. Ask it to 'find the requirements' and it hands you what looks like typical requirements on the surface. Implicit constraints, business context, external dependencies look different. The model doesn't recognize them as requirements and walks right past. But with a narrow target ('find only regulatory and operational constraints'), the model literally shrinks its search zone and pulls up what was sinking under the broad request. F1 rose from 0.71 to 0.88 — purely from prompt structure. Not more data, not fine-tuning. Just different request boundaries.

When to apply

Document analysis → any long text with implicit requirements: client briefs, technical specs, contracts, project descriptions — especially when the client writes chaotically and mixes everything up. Especially useful when you need to figure out 'what are we even building' from a raw, poorly structured incoming document. NOT a fit for: short one-paragraph texts — some categories will come out empty; creative or open-ended tasks with no fixed structure.

Mini recipe

1. Take a document to analyze: a spec, brief, contract, client email — what matters is that there's something to find. The method shines on long, multi-part texts. 2. Add four categories with explanations: for each, write 2-3 hint questions about what exactly belongs there. Not just 'CATEGORY E', but 'CATEGORY E — Environment: external systems, regulatory requirements, operating conditions'. 3. Tell it to go in order: add 'don't move on to the next category until you've finished the current one'. Without that, the model will mix up the sections. 4. Add a conflict check at the end: 'point out contradictions and overlaps between categories' — that's free verification. This is where the things you need to clarify with the client on a call surface.

Examples

[BAD]: `Extract all the requirements from this technical spec` [GOOD]: `Break down this spec across four categories — go through each one completely, don't move on to the next until you've finished. CATEGORY P — PROJECT: who the client is and what kind of company, who the users are, timeline, budget, team makeup. CATEGORY E — ENVIRONMENT: external systems and integrations, regulatory and legal constraints, operating conditions (mobile devices, offline mode). CATEGORY G — GOALS: business objectives behind the product, success criteria, what the user wants to get, which pain points we solve. CATEGORY S — SYSTEM: what exactly the system must do, non-functional requirements — speed, security, reliability, scale. For each category — a list. At the end — contradictions between categories. Spec: [text]`

In plain words

Here's the deal: when you ask a model to "pull the requirements out of this text", it acts like a lazy intern — it grabs whatever's lying on the surface and completely ignores the context. Models were trained on typical task lists, so they hunt for explicit phrasing like "the system shall...". But real requirements are often buried in descriptions of business processes or hardware constraints. PEGS prompting forces the LLM to change tactics: instead of looking at the text as a whole, it puts on four different lenses — Project, Environment, Goals, System — and scans the document layer by layer.

It's like going to buy a house. A normal search is just checking that it has walls and a roof. PEGS is when you bring along a lawyer, a plumber, a designer and someone who knows the neighborhood. Each of them hunts for their own kind of problem: one looks at the pipes, another at the paperwork, a third at the view out the window. Instead of a lame "house seems fine", you get a full rundown of the risks you'd never have thought to ask about.

All the magic is packed into one prompt split into sections. First the model pulls out the Project (who started this and why), then the Environment (where it's going to run), then the Goals (what payoff we expect), and only at the end the System (the technical meat). This approach kills the main weakness of models — their pull toward "the most probable answer". Once you set hard category boundaries, the model stops hallucinating generic phrases and starts noticing implicit dependencies it used to dismiss as "background noise".

It was tested on software, but the principle is universal. You can stretch this scheme over any complex breakdown: from analyzing legal contracts to deconstructing marketing briefs. If a text is full of hidden meaning and a pile of conditions, structured analysis along four axes will drag them into the light. It turns the LLM from a simple summarizer into an analytical powerhouse that doesn't just retell things but actually understands the structure of the task.

Bottom line: stop feeding the model raw chunks of text and waiting for a miracle. Use the PEGS framework to make the model dig deep instead of wide. Without clear structure you get a list of obvious things you already knew; with it, you get a full requirements map, including the ones the client forgot to say out loud. If you don't structure your prompts, you get garbage out and burn time on rework.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on PEGS Prompting: Split an Extraction Task into 4 Categories and Get the Full Picture Instead of Half arXiv:2603.23482

Sign in to apply this study New accounts get 50 free credits.