Repository navigation
Expand file tree
/
Copy pathPRD.txt
More file actions
318 lines (165 loc) · 6.25 KB
/
Copy pathPRD.txt
File metadata and controls
318 lines (165 loc) · 6.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
Product Requirements Document (PRD)
Project Title
Selective Retrieval and Grounded Self-Refinement for Reliable Retrieval-Augmented Generation
1. Background & Context
Retrieval-Augmented Generation (RAG) is widely used to ground large language models with external knowledge. However, most RAG systems retrieve documents for every query, regardless of necessity. This static design results in:
unnecessary retrieval cost and latency,
noisy context injection,
hallucinations when retrieved evidence is weak or contradictory.
Recent work in agentic reasoning, tool usage, and self-refinement has shown promise, but these techniques are typically evaluated in isolation. There is a lack of systems-level research that integrates selective retrieval control, grounding validation, and iterative self-correction into a single, rigorously evaluated RAG architecture.
2. Problem Statement
Static RAG pipelines lack control and verification mechanisms. They cannot:
Decide whether retrieval is necessary.
Evaluate the adequacy of retrieved evidence.
Detect and correct hallucinations caused by weak grounding.
Quantify decision quality or failure modes.
As a result, existing systems trade efficiency for reliability without measurable justification.
3. Objectives
Primary Objective
Design and evaluate a model-agnostic agentic RAG system that improves factual reliability and efficiency through selective retrieval, grounding-aware validation, and self-refinement.
Secondary Objectives
Reduce unnecessary retrieval operations.
Explicitly detect and manage failure cases.
Provide transparent evaluation of decision quality.
Maintain reproducibility using standard benchmarks and pretrained components.
4. Success Criteria (Measurable)
The system is considered successful if it satisfies all of the following:
Matches or exceeds static RAG accuracy on benchmark tasks.
Demonstrates a statistically significant reduction in retrieval calls.
Reduces hallucination rate relative to static RAG.
Achieves higher decision accuracy than heuristic baselines.
Shows consistent gains in ablation studies.
No state-of-the-art claims are required.
5. Non-Goals (Explicit Exclusions)
Training or fine-tuning large language models
Reinforcement learning
Robotics or embodied environments
Novel datasets or benchmarks
Claims of autonomy or intelligence
This project is a systems and evaluation contribution, not a learning-theory contribution.
6. System Overview
The system is an agent-controlled RAG pipeline composed of six deterministic modules:
Agent Controller
Retrieval Decision Module
Retrieval Engine
Grounding & Feasibility Scoring
Answer Generation
Self-Refinement Loop
Each module corresponds to established prior work and is independently ablated.
7. Prior Work Integration (Explicit Mapping)
Retrieval Backbone
Motivated by REALM and implemented using Dense Passage Retrieval.
Dual-encoder dense retrieval
FAISS vector index
Top-k passage retrieval
No retriever training
Agent Controller
Based on ReAct.
Thought → Action → Observation loop
Deterministic step limits
Explicit action logging
Actions: retrieve, refine query, generate, abstain
Tool / Retrieval Decision
Inspired by Toolformer.
Binary decision: retrieve vs no retrieve
Decision inputs:
model confidence estimate
expected retrieval benefit
prior failure signals
Implemented via prompt-based control, not training
Grounding & Feasibility Scoring
Adapted from Do As I Can Not As I Say.
Relevance score (query–passage alignment)
Consistency score (inter-passage agreement)
Contradiction detection
Threshold-based acceptance or rejection
Self-Refinement Loop
Based on Self-Refine.
Triggered only when grounding improves
Bounded iteration budget
Refinement success tracked
Early termination on stagnation
Long-Horizon Design Principles
Structural inspiration from Voyager.
Stable agent loop design
Memory of past failures
No embodiment or skill learning
8. Detailed Workflow
User query received
Agent reasons about answerability
Retrieval decision made
If retrieval required:
Dense retrieval executed
Grounding and contradiction checks applied
Answer generated
Self-refinement triggered if grounding insufficient
Abstention allowed if grounding fails repeatedly
Final answer returned with evidence
All intermediate decisions are logged.
9. Functional Requirements
FR-1: Selective Retrieval
The system must decide whether retrieval is necessary for each query.
FR-2: Decision Transparency
The system must log retrieval decisions and confidence estimates.
FR-3: Grounding Validation
The system must reject answers lacking sufficient evidence.
FR-4: Self-Correction
The system must attempt refinement when grounding improves.
FR-5: Abstention
The system must abstain rather than hallucinate when evidence is insufficient.
10. Non-Functional Requirements
Deterministic execution
Reproducible results
Bounded latency
Modular design for ablation
Hardware-agnostic deployment
11. Evaluation Plan
Datasets
HotpotQA (multi-hop reasoning)
FEVER (fact verification)
Baselines
LLM without retrieval
Static RAG (always retrieve)
ReAct with always-retrieve
Metrics
Exact Match (EM)
F1 Score
Evidence precision
Hallucination rate
Retrieval calls per query
Token usage and latency
Decision-Quality Metrics
Unnecessary Retrieval Rate
Missed Retrieval Rate
Retrieval Decision Accuracy
Oracle policy comparison
12. Ablation Studies
Selective vs always retrieve
With vs without grounding
With vs without self-refinement
With vs without abstention
Single-pass vs agent loop
13. Failure Analysis (Required Section)
Failures are categorized into:
Retrieval failure
Decision failure
Grounding failure
Refinement failure
Each category is quantified and discussed.
14. Risks & Mitigation
Risk Mitigation
Agent instability Step limits, deterministic logic
Latency overhead Selective retrieval
Overfitting heuristics Oracle comparison
Reviewer skepticism Strong ablations
15. Deliverables
Fully reproducible codebase
Experiment logs
System diagram
IEEE-formatted research paper
Ablation and failure analysis tables
16. Publication Positioning
Category: AI Systems / Applied NLP
Contribution type: Architecture + evaluation
Target venues: IEEE conferences and journals
Claims are conservative, evidence-driven, and reproducible.