PranjalZetsu commited on
Commit
84d6926
·
verified ·
1 Parent(s): 823ed3a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +138 -144
README.md CHANGED
@@ -9,200 +9,194 @@ tags:
9
  - unsloth
10
  ---
11
 
12
- # Model Card for Model ID
13
-
14
- <!-- Provide a quick summary of what the model is/does. -->
15
-
16
-
17
 
18
  ## Model Details
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
- ### Model Description
21
-
22
- <!-- Provide a longer summary of what this model is. -->
23
-
24
 
 
25
 
26
- - **Developed by:** [More Information Needed]
27
- - **Funded by [optional]:** [More Information Needed]
28
- - **Shared by [optional]:** [More Information Needed]
29
- - **Model type:** [More Information Needed]
30
- - **Language(s) (NLP):** [More Information Needed]
31
- - **License:** [More Information Needed]
32
- - **Finetuned from model [optional]:** [More Information Needed]
33
 
34
- ### Model Sources [optional]
 
 
 
 
35
 
36
- <!-- Provide the basic links for the model. -->
 
 
 
 
37
 
38
- - **Repository:** [More Information Needed]
39
- - **Paper [optional]:** [More Information Needed]
40
- - **Demo [optional]:** [More Information Needed]
41
 
42
  ## Uses
43
 
44
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
45
-
46
  ### Direct Use
47
-
48
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
49
-
50
- [More Information Needed]
51
-
52
- ### Downstream Use [optional]
53
-
54
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
55
-
56
- [More Information Needed]
57
 
58
  ### Out-of-Scope Use
 
 
 
59
 
60
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
61
-
62
- [More Information Needed]
63
 
64
  ## Bias, Risks, and Limitations
65
 
66
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
67
-
68
- [More Information Needed]
69
-
70
- ### Recommendations
71
-
72
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
73
-
74
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
75
-
76
- ## How to Get Started with the Model
77
-
78
- Use the code below to get started with the model.
79
-
80
- [More Information Needed]
81
-
82
- ## Training Details
83
-
84
- ### Training Data
85
-
86
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
87
-
88
- [More Information Needed]
89
-
90
- ### Training Procedure
91
-
92
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
93
-
94
- #### Preprocessing [optional]
95
 
96
- [More Information Needed]
97
-
98
-
99
- #### Training Hyperparameters
100
-
101
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
102
-
103
- #### Speeds, Sizes, Times [optional]
104
-
105
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
106
-
107
- [More Information Needed]
108
-
109
- ## Evaluation
110
-
111
- <!-- This section describes the evaluation protocols and provides the results. -->
112
-
113
- ### Testing Data, Factors & Metrics
114
-
115
- #### Testing Data
116
-
117
- <!-- This should link to a Dataset Card if possible. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Factors
122
-
123
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
124
-
125
- [More Information Needed]
126
-
127
- #### Metrics
128
-
129
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
130
-
131
- [More Information Needed]
132
-
133
- ### Results
134
-
135
- [More Information Needed]
136
-
137
- #### Summary
138
 
 
139
 
 
 
 
 
140
 
141
- ## Model Examination [optional]
 
142
 
143
- <!-- Relevant interpretability work for the model goes here -->
 
 
144
 
145
- [More Information Needed]
 
 
 
146
 
147
- ## Environmental Impact
 
 
 
148
 
149
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
 
 
 
 
150
 
151
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
 
152
 
153
- - **Hardware Type:** [More Information Needed]
154
- - **Hours used:** [More Information Needed]
155
- - **Cloud Provider:** [More Information Needed]
156
- - **Compute Region:** [More Information Needed]
157
- - **Carbon Emitted:** [More Information Needed]
158
 
159
- ## Technical Specifications [optional]
160
 
161
- ### Model Architecture and Objective
162
 
163
- [More Information Needed]
164
 
165
- ### Compute Infrastructure
 
 
 
 
166
 
167
- [More Information Needed]
 
 
 
 
168
 
169
- #### Hardware
 
170
 
171
- [More Information Needed]
172
 
173
- #### Software
174
 
175
- [More Information Needed]
 
 
176
 
177
- ## Citation [optional]
 
 
 
 
178
 
179
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
180
 
181
- **BibTeX:**
182
 
183
- [More Information Needed]
 
 
 
 
 
184
 
185
- **APA:**
 
 
 
 
 
186
 
187
- [More Information Needed]
188
 
189
- ## Glossary [optional]
190
 
191
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
 
 
 
192
 
193
- [More Information Needed]
194
 
195
- ## More Information [optional]
196
 
197
- [More Information Needed]
 
 
 
 
 
 
 
198
 
199
- ## Model Card Authors [optional]
200
 
201
- [More Information Needed]
202
 
203
- ## Model Card Contact
 
 
 
 
 
 
 
 
204
 
205
- [More Information Needed]
206
- ### Framework versions
207
 
208
- - PEFT 0.19.1
 
9
  - unsloth
10
  ---
11
 
 
 
 
 
 
12
 
13
  ## Model Details
14
+ **Developed by:** PranjalZetsu
15
+ - **Model type:** Causal Language Model fine-tuned via RL (GRPO)
16
+ - **Language(s):** English
17
+ - **License:** Apache 2.0
18
+ - **Finetuned from model:** [Qwen/Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct)
19
+
20
+ -
21
+ | Property | Value |
22
+ |---|---|
23
+ | **Base Model** | Qwen/Qwen2.5-7B |
24
+ | **Adapter Type** | LoRA (PEFT) |
25
+ | **Quantization** | 4-bit (bitsandbytes, NF4) |
26
+ | **Training Framework** | Unsloth + TRL (GRPO) |
27
+ | **PEFT Version** | 0.19.1 |
28
+ | **Task** | Text Generation / Agentic Reasoning |
29
+ | **Domain** | Semiconductor Fabrication, Yield Engineering |
30
 
31
+ ---
 
 
 
32
 
33
+ ## Model Description
34
 
35
+ Fab_Yield_Agent_Qwen-q4 is a domain-specialized language model fine-tuned for semiconductor fabrication yield analysis and optimization. Built on the Qwen2.5-7B-Instruct architecture and trained using Reinforcement Learning from verifiable rewards (GRPO), this model learns to reason through complex statistical and materials science problems with structured, step-by-step thinking.
 
 
 
 
 
 
36
 
37
+ ### The Problem: Semiconductor Yield Loss
38
+ Semiconductor manufacturing is one of the most complex industrial processes on Earth. A modern chip fab runs wafers through hundreds of steps, each controlled by multiple physical parameters (temperatures, pressures, gas flows). Even tiny deviations cascade into yield loss. This agent is trained to act as a process integration engineer:
39
+ - Analyzing yield data and identifying root causes.
40
+ - Navigating the physics of a 15-parameter process space.
41
+ - Converging on optimal manufacturing recipes within a limited experiment budget.
42
 
43
+ ### The Key Insight: RL Emergent Intelligence
44
+ During Reinforcement Learning, the model was rewarded purely on the correctness of final answers—not on intermediate reasoning steps. Spontaneously, it developed:
45
+ - **Deeper statistical reasoning:** Proactive use of Cpk, Poisson models, and control chart logic.
46
+ - **Material science grounding:** Reasoning through etch selectivity, deposition uniformity, and diffusion profiles.
47
+ - **Structured problem decomposition:** Breaking queries into logical sub-tasks before synthesizing conclusions.
48
 
49
+ ---
 
 
50
 
51
  ## Uses
52
 
 
 
53
  ### Direct Use
54
+ - **Fab yield triage:** Rapidly analyze incoming yield data and identify likely root causes.
55
+ - **Process window analysis:** Evaluate margin sensitivity across interconnected process steps.
56
+ - **Statistical process control (SPC):** Interpret control charts and flag out-of-control signals.
57
+ - **Material selection reasoning:** Assess tradeoffs between material properties and process compatibility.
 
 
 
 
 
 
58
 
59
  ### Out-of-Scope Use
60
+ - General purpose QA or creative writing.
61
+ - Safety-critical sign-off without human expert verification.
62
+ - Use as a replacement for certified TCAD/SPC simulation software.
63
 
64
+ ---
 
 
65
 
66
  ## Bias, Risks, and Limitations
67
 
68
+ - **Not a simulation substitute:** This model should not replace calibrated simulation tools like TCAD or certified SPC software.
69
+ - **4-bit quantization:** While efficient, there may be minor accuracy tradeoffs compared to full-precision models.
70
+ - **Domain Focus:** Performance on non-semiconductor tasks is not optimized.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
+ ## How to Get Started
75
 
76
+ ### Quick Inference
77
+ ```python
78
+ from transformers import AutoTokenizer, AutoModelForCausalLM
79
+ from peft import PeftModel
80
 
81
+ base_model = "unsloth/Qwen2.5-7B-Instruct-bnb-4bit"
82
+ adapter = "PranjalZetsu/Fab_Yield_Agent_Qwen-q4"
83
 
84
+ tokenizer = AutoTokenizer.from_pretrained(base_model)
85
+ model = AutoModelForCausalLM.from_pretrained(base_model, load_in_4bit=True, device_map="auto")
86
+ model = PeftModel.from_pretrained(model, adapter)
87
 
88
+ prompt = """You are a semiconductor yield engineer.
89
+ A 300mm fab sees 12% yield loss on a 7nm logic layer.
90
+ Defect density: 0.08 defects/cm2. Critical area: 150 cm2.
91
+ Perform a yield analysis and recommend corrective actions."""
92
 
93
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
94
+ outputs = model.generate(**inputs, max_new_tokens=1024, temperature=0.6, do_sample=True)
95
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
96
+ ```
97
 
98
+ ### Local Setup (Environment & API)
99
+ ```bash
100
+ # Clone the repository
101
+ git clone https://github.com/pranjalyt/fab-yield-agent.git
102
+ cd fab-yield-agent
103
 
104
+ # Install dependencies
105
+ pip install -r requirements.txt
106
 
107
+ # Run the API server
108
+ uvicorn server:app --host 0.0.0.0 --port 7860
109
+ ```
 
 
110
 
111
+ ---
112
 
113
+ ## System Architecture
114
 
115
+ The project includes a production-grade RL environment (FabYieldEnv) and a Response Surface Model (RSM) simulator.
116
 
117
+ ### RSMSimulator
118
+ A hidden ground truth engine that implements a second-order Response Surface Model. It captures non-linear interactions between 15 process parameters (Temperature, Etch Time, Pressure, etc.).
119
+ - **Normalization:** All parameters are mapped to [-1, 1] for scale-invariant modeling.
120
+ - **Interaction Terms:** Simulates how variables like Pressure and Gas Flow interact to control plasma density.
121
+ - **Dynamic Physics:** Every episode generates a fresh set of coefficients, forcing the agent to generalize its optimization strategy.
122
 
123
+ ### Defect Classification
124
+ The simulator produces physically motivated defect signatures:
125
+ - **Edge Ring:** Non-uniform plasma at wafer edges (linked to Pressure/Gas flow).
126
+ - **Center Spot:** Thermal hotspot at wafer center (linked to Temp/RF power).
127
+ - **Random Scatter:** Chemical contamination (linked to Dopant levels).
128
 
129
+ ### Senior Engineer Reviewer
130
+ A multi-agent layer that simulates the human approval gate. It enforces episode-varying qualification constraints (min yield, max variance, forbidden ranges).
131
 
132
+ ---
133
 
134
+ ## Training Details
135
 
136
+ ### Training Pipeline
137
+ 1. **Supervised Fine-Tuning (SFT):** Initial training on semiconductor reports, SPC problem sets, and material science Q&A.
138
+ 2. **Reinforcement Learning (GRPO):** Training via Group Relative Policy Optimization, rewarding answer correctness, structured thinking traces, and numerical precision.
139
 
140
+ ### Reward System (Four-Component Design)
141
+ - **Yield Reward (50%):** Continuous signal based on yield improvement.
142
+ - **Efficiency Reward (20%):** Sparse reward for hitting targets within the 12-experiment budget.
143
+ - **Causal Attribution (15%):** Reward for correctly identifying the primary bottleneck parameter in natural language.
144
+ - **Stability Reward (15%):** Reward for submitted recipes that show low lot-to-lot variance.
145
 
146
+ ---
147
 
148
+ ## Evaluation: Emergent Capabilities
149
 
150
+ ### Statistical Reasoning
151
+ | Capability | Before RL (SFT only) | After RL (GRPO) |
152
+ |---|---|---|
153
+ | Yield estimation | States a number | Derives from defect density + critical area |
154
+ | Process capability | Rarely mentions | Calculates Cpk from spec limits + sigma |
155
+ | Confidence intervals | Absent | Appears spontaneously in reasoning traces |
156
 
157
+ ### Materials Science Reasoning
158
+ | Capability | Before RL (SFT only) | After RL (GRPO) |
159
+ |---|---|---|
160
+ | Film uniformity | Generic description | Linked to deposition mechanism physically |
161
+ | Etch selectivity | Surface-level | Reasoned from underlying chemistry |
162
+ | Defect root cause | Names defect types | Traces cause to process physics |
163
 
164
+ ---
165
 
166
+ ## Research Theme Alignment
167
 
168
+ This work addresses several frontier AI research themes for OpenEnv India 2026:
169
+ - **World Modeling (Theme 3.1):** Modeling the partially observable professional world of a fab with physical and statistical constraints.
170
+ - **Long-Horizon Planning (Theme 2):** Decomposing multi-step yield investigations with sparse, outcome-based rewards across a 12-step budget.
171
+ - **Self-Improvement (Theme 4):** Emergent capability growth where the model discovers complex analytical tools to maximize its reward signal.
172
 
173
+ ---
174
 
175
+ ## Glossary
176
 
177
+ | Term | Definition |
178
+ |------|-----------|
179
+ | **Wafer** | A thin silicon disc on which chips are fabricated simultaneously |
180
+ | **Yield** | Percentage of working chips per wafer |
181
+ | **RSM** | Response Surface Methodology - statistical technique mapping inputs to outputs |
182
+ | **DoE** | Design of Experiments - systematic approach to planning experiments |
183
+ | **Lot** | A batch of typically 25 wafers processed together |
184
+ | **CMP** | Chemical-Mechanical Planarization - polishing process to flatten surfaces |
185
 
186
+ ---
187
 
188
+ ## Citation
189
 
190
+ ```bibtex
191
+ @misc{fab_yield_agent_qwen_q4,
192
+ author = {PranjalZetsu},
193
+ title = {Fab_Yield_Agent_Qwen-q4: RL-Trained Semiconductor Yield Reasoning Agent},
194
+ year = {2025},
195
+ publisher = {HuggingFace},
196
+ url = {https://huggingface.co/PranjalZetsu/Fab_Yield_Agent_Qwen-q4}
197
+ }
198
+ ```
199
 
200
+ ## Contact
 
201
 
202
+ For questions or feedback, open a discussion on the [Hugging Face Community tab](https://huggingface.co/PranjalZetsu/Fab_Yield_Agent_Qwen-q4/discussions).