Varshith dharmaj commited on
Commit
13d7e9f
·
verified ·
1 Parent(s): 0854b7b

Upload docs/PROJECT_REPORT_SKELETON.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. docs/PROJECT_REPORT_SKELETON.md +128 -128
docs/PROJECT_REPORT_SKELETON.md CHANGED
@@ -1,128 +1,128 @@
1
- # Project Report Skeleton for MVM²
2
-
3
- This document serves as a structured template for the final project report. It combines Markdown structure with standard LaTeX placeholders where applicable for formal formatting.
4
-
5
- ---
6
-
7
- # 1. Introduction
8
-
9
- ## 1.1 Problem Statement
10
- The verification of mathematical reasoning generated by Large Language Models (LLMs) faces two distinct challenges:
11
- 1. **Hallucination:** LLMs often produce "step-by-step" reasoning that appears plausible but contains logical gaps or contradictions.
12
- 2. **Multimodal Noise:** When the input source is an image (handwritten or printed), Optical Character Recognition (OCR) errors introduce uncertainty (e.g., misinterpreting symbols like $\int$ vs $S$). Existing pipelines typically treat transcribed text as ground truth, leading to catastrophic error propagation.
13
-
14
- **Objective:** To develop *MVM²*, a multimodal verification system that integrates OCR confidence scores, symbolic execution, and multi-agent consensus to robustly verify mathematical solutions.
15
-
16
- ## 1.2 Motivation
17
- - Requirement for trusted AI in education (automated grading, tutoring).
18
- - Limitations of "black box" verifiers (GPT-4) which lack explainability.
19
- - Need for formally verifiable metrics (SymPy) combined with semantic understanding (LLMs).
20
-
21
- ---
22
-
23
- # 2. Literature Review
24
-
25
- | Paper / Tool | Key Contribution | Limitation Addressed by MVM² |
26
- |---|---|---|
27
- | **Math-Verify (HuggingFace)** | Rule-based answer extraction & equivalency. | Lacks semantic logic checking; purely symbolic. |
28
- | **MathVerse (ECCV 2024)** | Multimodal benchmark for visual math. | Focuses on evaluation, not the *verification algorithm* itself. |
29
- | **Self-Consistency (Wang et al.)** | Majority voting for LLMs. | Computationally expensive; doesn't handle visual uncertainty. |
30
-
31
- ---
32
-
33
- # 3. Methodology & System Architecture
34
-
35
- ## 3.1 Overview
36
- The system adopts a modular microservice architecture consisting of seven key components:
37
- 1. **Input Receiver:** Validates multimodal inputs.
38
- 2. **Preprocessing:** Image binarization and noise reduction (OpenCV).
39
- 3. **OCR Service:** Hybrid extraction (Tesseract + Handwritten CNN).
40
- 4. **Representation:** Canonicalization to Intermediate Representation (IR).
41
- 5. **Verification Engine:** SymPy (Symbolic) + Multi-Agent LLMs (Logical).
42
- 6. **Classifier:** Weighted Consensus Scoring.
43
- 7. **Reporting:** Explainable feedback generation.
44
-
45
- ## 3.2 Formal Methods
46
-
47
- ### 3.2.1 OCR-Aware Confidence Propagation
48
- We propose a novel method to discount verification confidence based on visual uncertainty. Let $C_{ocr}$ be the OCR confidence score. The final confidence $C_{final}$ is calibrated as:
49
-
50
- $$
51
- C_{final} = S_{weighted} \times (\lambda + (1-\lambda)C_{ocr})
52
- $$
53
-
54
- Where $\lambda=0.9$ ensures a high floor for legibility but penalizes ambiguity.
55
-
56
- ### 3.2.2 Hybrid Scoring Function
57
- The validity score $S_{weighted}$ is computed from three independent signals:
58
-
59
- $$
60
- S_{weighted} = \alpha S_{sym} + \beta S_{log} + \gamma S_{clf}
61
- $$
62
-
63
- **Parameters:**
64
- - $\alpha = 0.40$ (Symbolic Accuracy)
65
- - $\beta = 0.35$ (Logical Consistency)
66
- - $\gamma = 0.25$ (Classifier Consensus)
67
-
68
- ## 3.3 Multi-Agent Consensus
69
- We utilize three agents with distinct prompts:
70
- 1. **Solver:** Independently solves the problem.
71
- 2. **Critic:** Reviews the provided steps for logical fallacies.
72
- 3. **Verifier:** Compares the Solver and User steps.
73
-
74
- **Hallucination Rate ($H$)** is defined as the fraction of steps where agents fail to reach consensus (similarity threshold $< 0.7$).
75
-
76
- ---
77
-
78
- # 4. Experiments
79
-
80
- ## 4.1 Dataset
81
- - **Sources:** Hand-curated samples, modified GSM8K subset.
82
- - **Types:** Text-only, Clean Images, Noisy Images (Gaussian noise added).
83
-
84
- ## 4.2 Ablation Studies
85
- We evaluated four configurations to quantify the contribution of each component:
86
-
87
- | Mode | Description |
88
- |---|---|
89
- | **M1: Baseline** | Single LLM (Gemini-Pro) without SymPy or OCR weighting. |
90
- | **M2: Hybrid** | Single LLM + SymPy verification. |
91
- | **M3: Consensus** | Multi-Agent LLM + SymPy (No OCR calibration). |
92
- | **M4: Full MVM²** | Full pipeline with OCR-aware confidence. |
93
-
94
- ---
95
-
96
- # 5. Results & Analysis
97
-
98
- ## 5.1 Quantitative Results via `run_evaluation.py`
99
-
100
- *(Insert table from `evaluation_results.csv` here)*
101
-
102
- | Mode | Accuracy | Hallucination Rate | Avg Latency |
103
- |---|---|---|---|
104
- | M1 (Baseline) | Low | High | Low |
105
- | M4 (Full) | **High** | **Low** | Moderate |
106
-
107
- **Key Finding:** The multi-agent approach reduced the hallucination rate by **X%** compared to the baseline.
108
-
109
- ## 5.2 Case Studies
110
- - **Case A (Ambiguous Handwriting):** M4 correctly flagged "Low Confidence" due to OCR uncertainty, whereas M1 confidently marked it incorrect based on bad transcription.
111
- - **Case B (Algebraic Error):** SymPy component ($S_{sym}$) detected a subtle sign error that the LLM ($S_{log}$) missed.
112
-
113
- ---
114
-
115
- # 6. Limitations & Future Work
116
-
117
- ## 6.1 Limitations
118
- - **Latency:** Multi-agent calls increase response time (~3-4s).
119
- - **OCR Dependency:** Extremely poor handwriting still fails early in the pipeline.
120
-
121
- ## 6.2 Future Work
122
- - **Fine-tuning:** Train a dedicated small model (SLM) for the Critic role to reduce latency.
123
- - **Visual-LLM Integration:** Feed images directly to Gemini 1.5 Pro to bypass OCR for complex geometry problems.
124
-
125
- ---
126
-
127
- # 7. Conclusion
128
- MVM² successfully demonstrates that integrating formal symbolic methods with probabilistic LLM reasoning—calibrated by visual uncertainty—significantly improves the reliability of mathematical verification systems.
 
1
+ # Project Report Skeleton for MVM²
2
+
3
+ This document serves as a structured template for the final project report. It combines Markdown structure with standard LaTeX placeholders where applicable for formal formatting.
4
+
5
+ ---
6
+
7
+ # 1. Introduction
8
+
9
+ ## 1.1 Problem Statement
10
+ The verification of mathematical reasoning generated by Large Language Models (LLMs) faces two distinct challenges:
11
+ 1. **Hallucination:** LLMs often produce "step-by-step" reasoning that appears plausible but contains logical gaps or contradictions.
12
+ 2. **Multimodal Noise:** When the input source is an image (handwritten or printed), Optical Character Recognition (OCR) errors introduce uncertainty (e.g., misinterpreting symbols like $\int$ vs $S$). Existing pipelines typically treat transcribed text as ground truth, leading to catastrophic error propagation.
13
+
14
+ **Objective:** To develop *MVM²*, a multimodal verification system that integrates OCR confidence scores, symbolic execution, and multi-agent consensus to robustly verify mathematical solutions.
15
+
16
+ ## 1.2 Motivation
17
+ - Requirement for trusted AI in education (automated grading, tutoring).
18
+ - Limitations of "black box" verifiers (GPT-4) which lack explainability.
19
+ - Need for formally verifiable metrics (SymPy) combined with semantic understanding (LLMs).
20
+
21
+ ---
22
+
23
+ # 2. Literature Review
24
+
25
+ | Paper / Tool | Key Contribution | Limitation Addressed by MVM² |
26
+ |---|---|---|
27
+ | **Math-Verify (HuggingFace)** | Rule-based answer extraction & equivalency. | Lacks semantic logic checking; purely symbolic. |
28
+ | **MathVerse (ECCV 2024)** | Multimodal benchmark for visual math. | Focuses on evaluation, not the *verification algorithm* itself. |
29
+ | **Self-Consistency (Wang et al.)** | Majority voting for LLMs. | Computationally expensive; doesn't handle visual uncertainty. |
30
+
31
+ ---
32
+
33
+ # 3. Methodology & System Architecture
34
+
35
+ ## 3.1 Overview
36
+ The system adopts a modular microservice architecture consisting of seven key components:
37
+ 1. **Input Receiver:** Validates multimodal inputs.
38
+ 2. **Preprocessing:** Image binarization and noise reduction (OpenCV).
39
+ 3. **OCR Service:** Hybrid extraction (Tesseract + Handwritten CNN).
40
+ 4. **Representation:** Canonicalization to Intermediate Representation (IR).
41
+ 5. **Verification Engine:** SymPy (Symbolic) + Multi-Agent LLMs (Logical).
42
+ 6. **Classifier:** Weighted Consensus Scoring.
43
+ 7. **Reporting:** Explainable feedback generation.
44
+
45
+ ## 3.2 Formal Methods
46
+
47
+ ### 3.2.1 OCR-Aware Confidence Propagation
48
+ We propose a novel method to discount verification confidence based on visual uncertainty. Let $C_{ocr}$ be the OCR confidence score. The final confidence $C_{final}$ is calibrated as:
49
+
50
+ $$
51
+ C_{final} = S_{weighted} \times (\lambda + (1-\lambda)C_{ocr})
52
+ $$
53
+
54
+ Where $\lambda=0.9$ ensures a high floor for legibility but penalizes ambiguity.
55
+
56
+ ### 3.2.2 Hybrid Scoring Function
57
+ The validity score $S_{weighted}$ is computed from three independent signals:
58
+
59
+ $$
60
+ S_{weighted} = \alpha S_{sym} + \beta S_{log} + \gamma S_{clf}
61
+ $$
62
+
63
+ **Parameters:**
64
+ - $\alpha = 0.40$ (Symbolic Accuracy)
65
+ - $\beta = 0.35$ (Logical Consistency)
66
+ - $\gamma = 0.25$ (Classifier Consensus)
67
+
68
+ ## 3.3 Multi-Agent Consensus
69
+ We utilize three agents with distinct prompts:
70
+ 1. **Solver:** Independently solves the problem.
71
+ 2. **Critic:** Reviews the provided steps for logical fallacies.
72
+ 3. **Verifier:** Compares the Solver and User steps.
73
+
74
+ **Hallucination Rate ($H$)** is defined as the fraction of steps where agents fail to reach consensus (similarity threshold $< 0.7$).
75
+
76
+ ---
77
+
78
+ # 4. Experiments
79
+
80
+ ## 4.1 Dataset
81
+ - **Sources:** Hand-curated samples, modified GSM8K subset.
82
+ - **Types:** Text-only, Clean Images, Noisy Images (Gaussian noise added).
83
+
84
+ ## 4.2 Ablation Studies
85
+ We evaluated four configurations to quantify the contribution of each component:
86
+
87
+ | Mode | Description |
88
+ |---|---|
89
+ | **M1: Baseline** | Single LLM (Gemini-Pro) without SymPy or OCR weighting. |
90
+ | **M2: Hybrid** | Single LLM + SymPy verification. |
91
+ | **M3: Consensus** | Multi-Agent LLM + SymPy (No OCR calibration). |
92
+ | **M4: Full MVM²** | Full pipeline with OCR-aware confidence. |
93
+
94
+ ---
95
+
96
+ # 5. Results & Analysis
97
+
98
+ ## 5.1 Quantitative Results via `run_evaluation.py`
99
+
100
+ *(Insert table from `evaluation_results.csv` here)*
101
+
102
+ | Mode | Accuracy | Hallucination Rate | Avg Latency |
103
+ |---|---|---|---|
104
+ | M1 (Baseline) | Low | High | Low |
105
+ | M4 (Full) | **High** | **Low** | Moderate |
106
+
107
+ **Key Finding:** The multi-agent approach reduced the hallucination rate by **X%** compared to the baseline.
108
+
109
+ ## 5.2 Case Studies
110
+ - **Case A (Ambiguous Handwriting):** M4 correctly flagged "Low Confidence" due to OCR uncertainty, whereas M1 confidently marked it incorrect based on bad transcription.
111
+ - **Case B (Algebraic Error):** SymPy component ($S_{sym}$) detected a subtle sign error that the LLM ($S_{log}$) missed.
112
+
113
+ ---
114
+
115
+ # 6. Limitations & Future Work
116
+
117
+ ## 6.1 Limitations
118
+ - **Latency:** Multi-agent calls increase response time (~3-4s).
119
+ - **OCR Dependency:** Extremely poor handwriting still fails early in the pipeline.
120
+
121
+ ## 6.2 Future Work
122
+ - **Fine-tuning:** Train a dedicated small model (SLM) for the Critic role to reduce latency.
123
+ - **Visual-LLM Integration:** Feed images directly to Gemini 1.5 Pro to bypass OCR for complex geometry problems.
124
+
125
+ ---
126
+
127
+ # 7. Conclusion
128
+ MVM² successfully demonstrates that integrating formal symbolic methods with probabilistic LLM reasoning—calibrated by visual uncertainty—significantly improves the reliability of mathematical verification systems.