Skip to content

Commit 125f9cd

Browse files
Rendering updates for the RFT with model grader cookbook (#1862)
1 parent 26a7b5a commit 125f9cd

File tree

2 files changed

+23
-34
lines changed

2 files changed

+23
-34
lines changed

examples/Reinforcement_Fine_Tuning.ipynb

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@
689689
"\n",
690690
"We can visualize the full score distribution on the training set.\n",
691691
"\n",
692-
"> **Note:** : In practice, analyzing model errors at scale often involves a mix of manual review and automated methods-like tagging failure types or clustering predictions by score and content. That workflow is beyond the scope of this guide, but it's a valuable next step once you've identified broad patterns."
692+
"> Note: In practice, analyzing model errors at scale often involves a mix of manual review and automated methods-like tagging failure types or clustering predictions by score and content. That workflow is beyond the scope of this guide, but it's a valuable next step once you've identified broad patterns."
693693
]
694694
},
695695
{
@@ -1968,7 +1968,7 @@
19681968
"source": [
19691969
"Looking at the distruibution of scores, we observe that RFT helped shift the model’s predictions out of the mid-to-low score zone (0.4–0.5) and into the mid-to-high range (0.5–0.6). Since the grader emphasizes clinical similarity over lexical match, this shift reflects stronger medical reasoning-not just better phrasing-according to our *expert* grader. As observed in the 0.9-1.0 range, some verbosity crept in despite mitigations and slightly lowering scores throughout, though it often reflected more complete, semantically aligned answers. A future grader pass could better account for these cases.\n",
19701970
"\n",
1971-
"Note, because the earlier `combined_grader` was designed to reward lexical correctness, its accuracy didnʼt improve much-which is expected. That gap reinforces why validating your model grader is critical, and why you should monitor for reward-hacking. In our case, we used `o3` to spot-check grading behavior, but domain expert review is essential. "
1971+
"Note that, because the earlier `combined_grader` was designed to reward lexical correctness, its accuracy didnʼt improve much-which is expected. That gap reinforces why validating your model grader is critical, and why you should monitor for reward-hacking. In our case, we used `o3` to spot-check grading behavior, but domain expert review is essential. "
19721972
]
19731973
},
19741974
{
@@ -2019,22 +2019,17 @@
20192019
},
20202020
{
20212021
"cell_type": "code",
2022-
"execution_count": null,
2022+
"execution_count": 1,
20232023
"metadata": {},
20242024
"outputs": [
20252025
{
2026-
"data": {
2027-
"text/markdown": [
2028-
"**Classifying staging type**\n",
2029-
"\n",
2030-
"The user provided a clinical scenario of a 35-year-old female with a 5 cm oral tumor and a 2 cm lymph node. They're asking how to stage it according to the TNM classification. This is a diagnosis query, so the correct answer type here is \"diagnosis.\" Considering the tumor's size, it appears to be classified as T3 since it's greater than 4 cm. Thus, I think the staging might be Stage II, but I'll confirm that."
2031-
],
2032-
"text/plain": [
2033-
"<IPython.core.display.Markdown object>"
2034-
]
2035-
},
2036-
"metadata": {},
2037-
"output_type": "display_data"
2026+
"name": "stdout",
2027+
"output_type": "stream",
2028+
"text": [
2029+
"Classifying staging type\n",
2030+
"\n",
2031+
"The user provided a clinical scenario of a 35-year-old female with a 5 cm oral tumor and a 2 cm lymph node. They're asking how to stage it according to the TNM classification. This is a diagnosis query, so the correct answer type here is \"diagnosis.\" Considering the tumor's size, it appears to be classified as T3 since it's greater than 4 cm. Thus, I think the staging might be Stage II, but I'll confirm that.\n"
2032+
]
20382033
}
20392034
],
20402035
"source": [
@@ -2045,27 +2040,21 @@
20452040
},
20462041
{
20472042
"cell_type": "code",
2048-
"execution_count": null,
2043+
"execution_count": 2,
20492044
"metadata": {},
20502045
"outputs": [
20512046
{
2052-
"data": {
2053-
"text/markdown": [
2054-
"**Clarifying T staging for cancers**\n",
2055-
"\n",
2056-
"I’m digging into T staging for head and neck cancers in the oral cavity. So, T1 applies to tumors 2 cm or less, T2 for those over 2 cm but not more than 4 cm, and T3 is for tumors over 4 cm. T4a indicates invasion into adjacent structures. The patient's tumor measures 5 cm, which is over 4 cm. I’m not sure if it fits T3 or T4a, since T4a involves additional invasiveness, not just size.\n",
2057-
"**Determining T and N staging**\n",
2058-
"\n",
2059-
"I’m looking at a 5 cm tumor in the oral cavity. It seems there’s no mention of invasion into adjacent structures, so I’m categorizing it as T3 due to its size. T4a usually means invasion into structures like bone or skin. According to the TNM classification, since I see no such invasion, T classification remains T3.\n",
2060-
"\n",
2061-
"Moving on to N staging, I see there's a single lymph node of 2 cm on the same side; this fits the N1 classification for metastasis, as it’s less than 3 cm."
2062-
],
2063-
"text/plain": [
2064-
"<IPython.core.display.Markdown object>"
2065-
]
2066-
},
2067-
"metadata": {},
2068-
"output_type": "display_data"
2047+
"name": "stdout",
2048+
"output_type": "stream",
2049+
"text": [
2050+
"Clarifying T staging for cancers\n",
2051+
"\n",
2052+
"I’m digging into T staging for head and neck cancers in the oral cavity. So, T1 applies to tumors 2 cm or less, T2 for those over 2 cm but not more than 4 cm, and T3 is for tumors over 4 cm. T4a indicates invasion into adjacent structures. The patient's tumor measures 5 cm, which is over 4 cm. I’m not sure if it fits T3 or T4a, since T4a involves additional invasiveness, not just size. Determining T and N staging\n",
2053+
"\n",
2054+
"I’m looking at a 5 cm tumor in the oral cavity. It seems there’s no mention of invasion into adjacent structures, so I’m categorizing it as T3 due to its size. T4a usually means invasion into structures like bone or skin. According to the TNM classification, since I see no such invasion, T classification remains T3.\n",
2055+
"\n",
2056+
"Moving on to N staging, I see there's a single lymph node of 2 cm on the same side; this fits the N1 classification for metastasis, as it’s less than 3 cm.\n"
2057+
]
20692058
}
20702059
],
20712060
"source": [

registry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
path: examples/Reinforcement_Fine_Tuning.ipynb
2020
date: 2025-05-23
2121
authors:
22-
- theophile-openai
22+
- theophile-oai
2323
tags:
2424
- reinforcement-learning
2525
- fine-tuning

0 commit comments

Comments
 (0)