Skip to content

Conversation

@vincentzed
Copy link
Contributor

Motivation

Dependent on #13666

You could test it like:
python -m sglang.launch_server --model-path allenai/Olmo-3-32B-Think --mem-fraction-static 0.8 --reasoning-parser olmo3

Do a curl

curl -s http://127.0.0.1:30000/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"allenai/Olmo3-607B-Think","messages":[{"role":"user","content":"Explain step by step how to compute 18 * 23 without a calculator."}],"temperature":0.2,"max_tokens":10000}' > olmo3_chat_completion.json

Here is the full response:

{
  "id": "5f969fa72e6e4346b94dbd8af137c43d",
  "object": "chat.completion",
  "created": 1763664572,
  "model": "allenai/OLMo-3-Lago-90B",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "\n\nTo compute \\(18 \\times 23\\) without a calculator, we can use multiple methods to verify the result. Here are the key steps using different approaches:\n\n### 1. **Standard Multiplication Algorithm**\n   - Multiply 18 by the units digit of 23 (3):\n     \\[\n     3 \\times 18 = 54\n     \\]\n   - Multiply 18 by the tens digit of 23 (2), shifting one position to the left (equivalent to multiplying by 20):\n     \\[\n     2 \\times 18 = 36 \\quad \\text{(shifted left becomes 360)}\n     \\]\n   - Add the partial products:\n     \\[\n     54 + 360 = 414\n     \\]\n\n### 2. **Distributive Property**\n   - Break down 23 into \\(20 + 3\\):\n     \\[\n     18 \\times 23 = 18 \\times (20 + 3) = (18 \\times 20) + (18 \\times 3)\n     \\]\n   - Calculate each part:\n     \\[\n     18 \\times 20 = 360 \\quad \\text{and} \\quad 18 \\times 3 = 54\n     \\]\n   - Add the results:\n     \\[\n     360 + 54 = 414\n     \\]\n\n### 3. **Russian Peasant Method**\n   - Halve 18 and double 23 until the halved number is 1, then sum the doubled numbers corresponding to odd halves:\n     \\[\n     \\begin{array}{c|c}\n     18 & 23 \\\\\n     9 & 46 \\quad (\\text{odd, keep 46}) \\\\\n     4 & 92 \\\\\n     2 & 184 \\\\\n     1 & 368 \\quad (\\text{odd, keep 368}) \\\\\n     \\end{array}\n     \\]\n   - Sum the kept values:\n     \\[\n     46 + 368 = 414\n     \\]\n\n### 4. **Algebraic Expansion**\n   - Express 18 and 23 as \\(20 - 2\\) and \\(20 + 3\\) respectively:\n     \\[\n     (20 - 2)(20 + 3) = 20^2 + 20 \\times 3 - 2 \\times 20 - 2 \\times 3\n     \\]\n   - Calculate each term:\n     \\[\n     400 + 60 - 40 - 6 = 414\n     \\]\n\n### 5. **Verification by Alternative Subtraction**\n   - Compute \\(23 \\times 20\\) and subtract \\(23 \\times 2\\):\n     \\[\n     23 \\times 20 = 460 \\quad \\text{and} \\quad 23 \\times 2 = 46\n     \\]\n   - Subtract the results:\n     \\[\n     460 - 46 = 414\n     \\]\n\nAll methods consistently yield the result \\(\\boxed{414}\\).",
        "reasoning_content": "Okay, so I need to figure out how to multiply 18 by 23 without using a calculator. Hmm, let me think. I remember from school that there are different methods for multiplication, like the standard algorithm, lattice method, or maybe breaking it down into smaller parts. Let me try the standard way first because that's what I'm more familiar with.\n\nAlright, so 18 times 23. Let me write it down as if I'm doing it on paper. The bigger number is 23, so maybe I should put 23 on top and 18 below it? Wait, actually, it doesn't really matter which one is on top, but usually, we write the larger number first. But maybe it's easier if I align them by place value. Let me see. Let's write 18 as the top number and 23 as the bottom one. Wait, actually, maybe it's better to have the units digits aligned. Let me recall the standard multiplication steps.\n\nFirst, you multiply the units digit of the bottom number by the top number, then the tens digit, and add them up. Let me try that. So, 18 multiplied by 23. Let's break down 23 into 20 + 3. So, maybe I can do 18 times 20 plus 18 times 3. That might be easier. Let me try that approach.\n\nFirst, 18 times 20. Well, 18 times 2 is 36, and then since it's 20, I add a zero, making it 360. Okay, that part makes sense. Then 18 times 3. That's straightforward: 18*3 is 54. Now, add those two results together: 360 + 54. Let me add those. 360 plus 50 is 410, and then plus 4 more is 414. So, is 18*23 equal to 414? Wait, let me check that again because sometimes when I do mental math, I might make a mistake.\n\nAlternatively, maybe I should use the standard vertical multiplication method to verify. Let's try that. Writing it out:\n\n   18\nx 23\n------\n   ?\n\nStarting with the units digit of the bottom number, which is 3. Multiply 3 by 18. 3*8 is 24, write down 4 and carry over 2. Then 3*1 is 3, plus the carried over 2 is 5. So that gives 54. Then, moving to the tens digit of the bottom number, which is 2. But since it's in the tens place, it's actually 20. So we need to shift one position to the left, effectively multiplying by 10. So, 2 times 18. 2*8 is 16, write down 6 and carry over 1. Then 2*1 is 2 plus 1 is 3. So that gives 36, but shifted one place to the left, making it 360. Then add 54 and 360. Adding those together: 54 + 360. 50 + 360 is 410, plus 4 is 414. Okay, same result. So that seems consistent.\n\nWait, but let me try another method just to be sure. Maybe the distributive property again but breaking it down differently. 18 is 10 + 8, so (10 + 8)*23. Then distribute: 10*23 + 8*23. 10*23 is 230. 8*23: let's see, 8*20 is 160 and 8*3 is 24, so 160 +24 is 184. Then add 230 + 184. 230 + 184. 200 + 100 is 300, 30 + 80 is 110, so 300 + 110 is 410, then +4 is 414. Again, same answer. Hmm, so that's three different methods giving me 414. Maybe that's correct?\n\nBut let me try another way to confirm. Maybe using the lattice method? I'm a bit fuzzy on that, but let me recall. You draw a grid, right? For two-digit numbers, a 2x2 grid. So, split 18 into 1 and 8, and 23 into 2 and 3. Then multiply each pair and put the products in the grid. Then add the diagonals. Let me try.\n\nFirst, draw a square divided into four boxes. The top is 1 and 8, the sides are 2 and 3. So:\n\n    1   8\n  +-----+\n2 |     |\n  +-----+\n3 |     |\n  +-----+\n\nWait, actually, maybe it's the other way around. Let me check. The lattice method for 18 x 23. Each digit of the first number is on top, each digit of the second on the side. So:\n\n     1   8\n   +-------\n  2 |     |\n   +-------\n  3 |     |\n   +-------\n\nEach cell is the product of the row and column digits. So, first cell (2 and 1): 2*1=2. Next cell (2 and 8): 2*8=16. Then the next row, 3*1=3 and 3*8=24. So filling in the grid:\n\n     1   8\n   +-------\n  2 | 2   16\n   +-------\n  3 | 3   24\n   +-------\n\nThen, you add the numbers along the diagonals. Starting from the top right. The first diagonal (top right) is 16. Then the next diagonal is 2 + 3 = 5. Then the last diagonal is 24. Wait, but actually, I think the diagonals are summed with carrying over. Let me recall the exact steps. Each diagonal corresponds to a place value. The rightmost diagonal is the units, then tens, then hundreds.\n\nWait, maybe I need to split the products into tens and units. For example, 16 would be 1 ten and 6 units. So in the lattice, each cell is split into two parts: the tens and units. Let me try again with that in mind.\n\nSo for 2*8=16, we write 1 in the top triangle and 6 in the bottom. Similarly, 2*1=2 would be 0 and 2. 3*1=3 is 0 and 3. 3*8=24 is 2 and 4. So the grid would look like:\n\n     1   8\n   +-------\n  2 | 0/2  1/6\n   +-------\n  3 | 0/3  2/4\n   +-------\n\nThen, adding along the diagonals:\n\nStarting from the rightmost diagonal (units place): 6 (from 1/6) + 4 (from 2/4) = 10. Write down 0 and carry over 1.\n\nNext diagonal (tens place): 2 (from 0/2) + 3 (from 0/3) + 1 (carry) = 6. Write down 6.\n\nNext diagonal (hundreds place): 1 (from 1/6) + 2 (from 2/4) = 3. Write down 3.\n\nSo putting it all together, we have 3 (hundreds), 6 (tens), 0 (units), but wait, the first diagonal gave us 10, so actually, the units digit is 0 with a carryover of 1 to the tens. Then the tens place was 2 + 3 +1 =6, and the hundreds is 1 +2 =3. So the total is 3 6 0, but wait, that would be 360? Wait, that can't be right because we know the answer should be 414. Hmm, I must have messed up the lattice method steps.\n\nWait, maybe I arranged the numbers wrong. Let me check again. Maybe the first number is 23 and the second is 18? Let me try switching them. Let me see. If I do 23 times 18 instead. Let's see:\n\n     2   3\n   +-------\n  1 |     |\n   +-------\n  8 |     |\n   +-------\n\nThen, 1*2=2, 1*3=3; 8*2=16, 8*3=24. Splitting into tens and units:\n\n     2   3\n   +-------\n  1 | 0/2  0/3\n   +-------\n  8 | 1/6  2/4\n   +-------\n\nNow, adding diagonals:\n\nRightmost diagonal (units): 3 (from 0/3) +4 (from 2/4) =7. Write 7, no carryover.\n\nNext diagonal (tens): 2 (from 0/2) +6 (from 1/6) +0 (no carry) =8. Write 8.\n\nNext diagonal (hundreds): 0 (from 0/2's tens?) Wait, maybe I need to track better. Wait, actually, the first diagonal (units) is the rightmost, then moving left. Let me list all the numbers:\n\nThe cells are:\n\nTop row (1) has 0/2 and 0/3. So the units digits are 2 and 3, but actually, the first cell (1 and 2) is 2, which is 0 tens and 2 units. The second cell (1 and 3) is 3, 0 and 3.\n\nSecond row (8) has 1/6 (from 8*2=16) and 2/4 (from 8*3=24). So the units digits here are 6 and 4, and the tens digits are 1 and 2.\n\nSo when adding diagonally:\n\nFirst diagonal (units place): 2 (from first row first cell) + 3 (from first row second cell) + 6 (from second row first cell) +4 (from second row second cell)? Wait, no, maybe I'm overcomplicating. Wait, in the lattice method, each diagonal corresponds to a place. Let me see an example.\n\nAlternatively, perhaps each diagonal is summed as follows:\n\nStarting from the top right:\n\nThe first diagonal (units) is the bottom right cell's units digit (4) plus the top right cell's units digit (3). Wait, maybe I need to visualize it better. Let me look up the lattice method steps mentally. Each cell's digits are split by a diagonal line, with the tens digit above and units below. Then, when adding, you sum along the diagonals from right to left, carrying over as needed.\n\nSo in the 23x18 example:\n\nThe grid would be:\n\n     2    3\n   +---------\n 1 | 0/2   0/3\n   +---------\n 8 |1/6    2/4\n   +---------\n\nSo the diagonals are:\n\n1. The rightmost diagonal (units place) is the bottom right cell's units (4) and the top right cell's units (3). Wait, actually, each diagonal is a line from top right to bottom left. So starting at the top right corner, moving down to the bottom left. The first diagonal is just the top right cell's units (3). Wait, maybe I need to think of each diagonal as the sum of all the cells along that diagonal.\n\nAlternatively, perhaps each diagonal corresponds to a digit place. The rightmost diagonal is units, next is tens, then hundreds, etc. Let's see:\n\nThe cells are arranged such that:\n\n- The cell at the intersection of 1 (from 18) and 2 (from 23) is 2 (1*2). Split into 0 and 2.\n\n- The cell at 1 and 3 is 3 (1*3), split into 0 and 3.\n\n- The cell at 8 and 2 is 16 (8*2), split into 1 and 6.\n\n- The cell at 8 and 3 is 24 (8*3), split into 2 and 4.\n\nNow, when adding diagonally:\n\nStarting from the rightmost diagonal (units place):\n\nThe units digits from all cells in that diagonal. Wait, actually, each diagonal is a line from top right to bottom left. The first diagonal (units) is the bottom right cell's units (4) and the cell above it? Hmm, maybe I need to think of each diagonal as the sum of the units digits from the cells in that diagonal. Let me try:\n\nThe diagonals are as follows:\n\n1. The rightmost diagonal (units place) includes the units digits from the cells in the bottom right. Wait, perhaps the first diagonal is the units digits of all the cells in the rightmost column? No, maybe not. Let me think of it step by step.\n\nAlternatively, here's a better way: when you draw the lattice, each multiplication result is split into tens and units in the cell. Then, you add the numbers along the diagonals, starting from the right. Each diagonal's sum contributes to a digit in the final result, with carries as needed.\n\nSo for the 23x18 example:\n\nThe grid with split digits:\n\n     2    3\n   +---------\n 1 | 0/2   0/3\n   +---------\n 8 |1/6    2/4\n   +---------\n\nNow, the diagonals are:\n\n1. The first diagonal (units place) is the bottom right cell's units digit (4) and the cell above it (0/3's units digit 3). Wait, actually, moving from the top right to bottom left, the first diagonal is the top right cell's units (3) and the cell below it (2/4's units 4). Wait, maybe it's better to list all the diagonals:\n\n- The rightmost diagonal (units) is the units digits of the rightmost column of cells. The rightmost column is the 3 column. The cells in that column are 0/3 (from 1*3) and 2/4 (from 8*3). Their units digits are 3 and 4. So 3 +4 =7. Write down 7, no carryover.\n\n- Next diagonal (tens place) is the tens digits from the rightmost column plus the units digits from the next column. Wait, maybe not. Let me see another approach. Each diagonal is a line from top right to bottom left. So starting at the top right corner (cell 0/3), moving down to the bottom left (cell 1/6). Wait, perhaps each diagonal is a line of cells. Let me try numbering the diagonals:\n\nDiagonal 1 (units): consists of the units digits from all cells in the first diagonal line. Let's see:\n\nLooking at the grid:\n\nThe cells are arranged in a 2x2 grid. The diagonals would be:\n\n- Diagonal 1 (units): the cell at (1,3) [top right] and (8,2) [bottom left]? Not sure. Maybe it's better to think of each diagonal as starting from the top right and moving down-left. So:\n\nFirst diagonal (units place): the cell at position (1,3) which is 0/3 (units digit 3) and the cell below it? Wait, maybe the diagonals are:\n\nStarting from the top right cell (0/3), moving down to the bottom left cell (1/6). But that's two cells. Their units digits are 3 and 6? Wait, no, 1/6 is the cell from 8*2=16, which is in the first column (2) and second row (8). Hmm, this is getting confusing. Maybe I should look for another way.\n\nAlternatively, perhaps the sum is done by adding all the numbers in each diagonal strip. Let me try adding all the units digits first. The units digits from all cells are 2 (from 0/2), 3 (from 0/3), 6 (from 1/6), and 4 (from 2/4). Wait, but that would be adding all units digits together, which would be 2+3+6+4=15. But that's not right because that would be 15 in the units place, which is not correct. So that approach is wrong.\n\nAlternatively, maybe the tens and units are separated properly. Let me try again. Each cell's top number is the tens digit, bottom is units. So:\n\nFor the cell 0/2 (from 1*2=2), the tens is 0, units 2.\n\nCell 0/3 (1*3=3): 0 and 3.\n\nCell 1/6 (8*2=16): 1 and 6.\n\nCell 2/4 (8*3=24): 2 and 4.\n\nNow, arrange them in the grid:\n\n     2    3\n   +---------\n 1 | 0/2   0/3\n   +---------\n 8 |1/6    2/4\n   +---------\n\nNow, to add the diagonals:\n\nStarting from the rightmost diagonal (units place):\n\nThis would be the units digits of the rightmost column. The rightmost column is the 3 column. The cells in that column are 0/3 (units 3) and 2/4 (units 4). So 3 +4 =7. Write down 7. No carryover.\n\nNext diagonal (tens place): This includes the tens digits from the rightmost column and the units digits from the next column to the left. Wait, the next column to the left is the 2 column. The units digits there are 2 (from 0/2) and 6 (from 1/6). So adding the tens from the right column (0 from 0/3 and 2 from 2/4? Wait, no. Wait, perhaps the tens digits from the right column's cells and the units digits from the left column's cells?\n\nAlternatively, the tens place diagonal includes:\n\n- The tens digit from the rightmost column's cells: 0 (from 0/3) and 2 (from 2/4). Wait, no, the tens digits in the right column are 0 (from 0/3) and 2 (from 2/4). But actually, the tens digits are the top numbers. So in the right column (3 column), the tens digits are 0 (from 0/3) and 2 (from 2/4). The units digits in the left column (2 column) are 2 (from 0/2) and 6 (from 1/6). So adding those: (0 + 2) + (2 +6) = 0+2 is 2, 2+6 is 8, total 10? Wait, this is getting too convoluted. Maybe I need to follow a systematic approach.\n\nAnother way: when you add the diagonals, each diagonal corresponds to a place value. The rightmost diagonal is units, next is tens, then hundreds, etc. Each diagonal's sum is the sum of all the numbers in that diagonal, considering their place values.\n\nLooking at the grid:\n\nThe cells are:\n\nTop row (1):\n\n- First cell (2 column): 0 (tens) and 2 (units)\n\n- Second cell (3 column): 0 (tens) and 3 (units)\n\nBottom row (8):\n\n- First cell (2 column):1 (tens) and 6 (units)\n\n- Second cell (3 column):2 (tens) and 4 (units)\n\nNow, the diagonals from top right to bottom left:\n\n1. The first diagonal (units place) includes the units digits from all cells that are on the main diagonal? Wait, perhaps the diagonals are as follows:\n\n- The main diagonal (from top left to bottom right) isn't the right way. Maybe the diagonals are from top right to bottom left. Let's list all the diagonals:\n\nStarting from the top right cell (0/3):\n\n- Diagonal 1 (units): this cell's units digit (3) and the cell below it (2/4's units digit 4). Wait, but below it is in the next row. Alternatively, moving down and left? Hmm.\n\nAlternatively, think of the grid as:\n\nPositions:\n\n(1,2) (1,3)\n\n(8,2) (8,3)\n\nWhere the first number is the row (1 or 8) and the second is the column (2 or 3). Then diagonals would be:\n\nDiagonal 1 (units): (1,3) and (8,2). Their units digits are 3 and 6. So 3 +6 =9. Wait, but 3 is from (1,3) units, and 6 is from (8,2) units. Then carryover?\n\nWait, maybe this is the way. Let's try:\n\nDiagonal 1 (units place): cells (1,3) and (8,2). Their units digits: 3 and 6. Sum is 9. Write down 9, no carryover.\n\nDiagonal 2 (tens place): cells (1,2) and (8,3). Their tens digits: 0 (from (1,2)) and 2 (from (8,3)). Plus the units digits from the previous diagonal's carryover? Wait, no. Wait, actually, the tens digits from these cells plus any carryover from the previous diagonal. Wait, perhaps the tens digits from these cells plus the units digits from the cells in the next diagonal? I'm confused.\n\nAlternatively, each diagonal's total is the sum of all the numbers in that diagonal, considering their place values. Let me try adding all the numbers in each diagonal:\n\nDiagonal 1 (units): the units digits from all cells that are on the first diagonal line. If the diagonals are from top right to bottom left:\n\n- The first diagonal (shortest) is just the cell (1,3) which is 0/3. Its units digit is 3.\n\nWait, maybe this is too confusing. Maybe I should give up on the lattice method for now since I'm getting tangled up, and since the other methods all gave me 414, which seems consistent.\n\nAlternatively, let me try another approach: using the difference of squares or some other formula. Wait, 18 and 23. Hmm, not sure if they can be expressed in a way that's helpful. 18 is 20 -2, 23 is 20 +3. Not sure if that helps. Alternatively, 18*23 = (20 -2)(20 +3) = 20^2 +20*3 -2*20 -2*3 = 400 +60 -40 -6 = 400 +20 -6 = 414. Oh! That works. Let me verify that step by step.\n\nExpanding (a - b)(a + c) where a=20, b=2, c=3. Wait, actually, (20 -2)(20 +3) is not exactly a standard formula, but expanding it:\n\n(20 - 2)(20 + 3) = 20*20 + 20*3 -2*20 -2*3 = 400 +60 -40 -6.\n\nCalculating each term:\n\n20*20 = 400\n\n20*3 = 60\n\n-2*20 = -40\n\n-2*3 = -6\n\nAdding them all together: 400 +60 is 460, minus 40 is 420, minus 6 is 414. Yep, same result. So that's another method. So that confirms it again.\n\nAlternatively, maybe using the Russian peasant method? Let me recall. That involves halving and doubling. Let's see:\n\nThe Russian peasant method: you write the two numbers, and repeatedly halve one and double the other, until the first is 1. Then add the doubled numbers corresponding to odd halves.\n\nLet me try with 18 and 23. Let's pick 18 as the one to halve.\n\nSet up two columns:\n\n18 | 23\n\nWe need to halve 18 until we get to 1, and double 23 each time, but only keep the doubled numbers when the halved number is odd.\n\nStarting:\n\n18 (even) | 23\n\nHalve 18: 9 (odd) | double 23: 46\n\n9 (odd) | 46\n\nHalve 9: 4 (even) | double 46: 92\n\n4 (even) | 92\n\nHalve 4: 2 (even) | double 92: 184\n\n2 (even) | 184\n\nHalve 2: 1 (odd) | double 184: 368\n\n1 (odd) | 368\n\nNow, we stop when the left column is 1. Now, we add all the numbers in the right column that correspond to an odd number in the left column. So:\n\nThe right column entries when left was odd: 46 (from 9), 368 (from 1). So 46 + 368 = 414. Perfect, that's the same answer again. So that's another method confirming 414.\n\nOkay, so multiple methods are giving me 414, so I feel confident that's the correct answer. But just to be thorough, let me do the multiplication step-by-step again using the standard algorithm.\n\nMultiplying 18 by 23:\n\nFirst, write them down:\n\n   18\n\nx 23\n\n------\n\nStart with the units digit of the lower number (3):\n\n3 * 18:\n\n3*8 =24. Write down 4, carry over 2.\n\n3*1 =3 +2=5. So first partial product is 54.\n\nNext, move to the tens digit of the lower number (2), which is 20. So we write a 0 as a placeholder in the next row.\n\n2*18:\n\n2*8=16. Write down 6, carry over 1.\n\n2*1=2 +1=3. So the second partial product is 36, but shifted one position to the left (because it's the tens place), making it 360.\n\nNow add the two partial products:\n\n  54\n\n+360\n\n------\n\nAdding: 54 + 360. 50 + 360 = 410, plus 4 is 414. Yep, same result.\n\nAlternatively, adding digit by digit:\n\nUnits place: 4 +0 =4\n\nTens place:5 +6 =11. Write down 1, carry over 1.\n\nHundreds place: 0 +3 +1 (carry) =4.\n\nSo total is 414.\n\nAlright, so all methods confirm that 18 multiplied by 23 is 414. I think that's solid. I don't see any mistakes in my calculations across the different methods. So the answer should be 414.\n\nBut just to be 100% sure, maybe I can compute 18*20 and 18*3 again. 18*20 is 360, 18*3 is 54. 360 +54 is indeed 414. Alternatively, 23*20 is 460, minus 23*2 is 46, so 460 -46 =414. Wait, that's another way: 23*(20 -2) =23*18. So 23*20=460, 23*2=46, so 460-46=414. Yep, that works too.\n\nSo, after all these checks, I'm confident the answer is 414. I think I've explored multiple methods and cross-verified them, so unless I made the same mistake in all methods (which is possible but unlikely), the result is correct.\n\n**Final Answer**\nThe result of 18 multiplied by 23 is \\boxed{414}.\n",
        "tool_calls": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "matched_stop": 100257
    }
  ],
  "usage": {
    "prompt_tokens": 40,
    "total_tokens": 6642,
    "completion_tokens": 6602,
    "prompt_tokens_details": null,
    "reasoning_tokens": 0
  },
  "metadata": { "weight_version": "default" }
}

W/o reasoning parser
It's broken.

{
  "id": "4869596efe594896ae351d068b037621",
  "object": "chat.completion",
  "created": 1763665143,
  "model": "allenai/OLMo-3-Lago-90B",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Okay, so I need to figure out how to multiply 18 by 23 without using a calculator. Hmm, let me think. I remember from school that there are different methods for multiplication, like the standard algorithm, lattice method, or maybe breaking it down into smaller parts. Let me try the standard way first because that's what I'm more familiar with.\n\nAlright, so 18 times 23. Let me write it down as if I'm doing it on paper. The larger number is 23, so maybe I'll put 23 on top and 18 below it? Wait, actually, it doesn't really matter which one is on top, but maybe aligning the digits properly is important. Let me set it up vertically:\n\n   23\nx 18\n------\n\nStarting from the rightmost digit of the bottom number, which is 8. I need to multiply 8 by each digit in 23. Let's do that step by step.\n\nFirst, multiply 8 by 3 (the units digit of 23). 8 times 3 is 24. I write down the 4 in the units place and carry over the 2 to the tens place. Then, multiply 8 by 2 (the tens digit of 23). 8 times 2 is 16, plus the carried-over 2 makes 18. So that gives me 184 as the first partial product. Wait, let me check that again. \n\nHold on, actually, when multiplying 8 by 2 (the tens place), that's 16, but since it's the tens place, it's actually 16 tens, which is 160. Then adding the 24 from the units gives 160 +24 = 184. Yeah, that's right. So the first partial product is 184.\n\nNow, moving to the next digit in the bottom number, which is 1 (the tens place of 18). But since it's in the tens place, I need to shift one position to the left, effectively multiplying by 10. So I'll write a 0 in the units place as a placeholder. Then multiply 1 by 3 (units digit of 23). 1 times 3 is 3. Then multiply 1 by 2 (tens digit of 23), which is 2. So that gives 23, but shifted one place to the left, making it 230. Wait, let me confirm. \n\nActually, when you do the second partial product, since the 1 is in the tens place, you multiply 1 by 23 and then shift it one position left, which is the same as multiplying by 10. So 1 times 23 is 23, times 10 is 230. So the second partial product is 230.\n\nNow, add the two partial products together: 184 + 230. Let's add them step by step. 184 + 200 is 384, then add the remaining 30 to get 414. Wait, is that right? Let me check again. 184 + 230. Adding the units digits: 4 + 0 = 4. Tens digits: 8 + 3 = 11. So write down 1 and carry over 1. Hundreds digits: 1 + 2 = 3, plus the carried over 1 makes 4. So total is 414. Hmm, that seems correct. But let me verify with another method to be sure.\n\nAlternatively, maybe breaking down the numbers into easier components. For example, 18 is 10 + 8, and 23 is 20 + 3. So using the distributive property: (10 + 8)(20 + 3). Let's expand that:\n\n10*20 + 10*3 + 8*20 + 8*3.\n\nCalculating each term:\n\n10*20 = 200\n\n10*3 = 30\n\n8*20 = 160\n\n8*3 = 24\n\nNow add them all together: 200 + 30 = 230; 230 + 160 = 390; 390 +24 = 414. Okay, same result. That's reassuring.\n\nAnother way: Maybe using the \"vertical\" method but in my head. Let's see. 18 times 20 is 360, and 18 times 3 is 54. Then add them together: 360 +54 = 414. Wait, that's another approach. Since 23 is 20 +3, so splitting the multiplication that way. That also works. Let me confirm:\n\n18 * 20: 18*2=36, then add a zero to make it 360.\n\n18*3: 18*3 is 54. Then 360 +54 is indeed 414. Yep, that's another valid method. So all these different methods are leading me to 414. \n\nBut maybe I should go through the standard algorithm again step by step to ensure I didn't make a mistake there. Let's do that again carefully.\n\nMultiplying 23 by 18:\n\nFirst, write them down:\n\n   23\nx 18\n------\n\nMultiply 23 by 8 (units place):\n\n3*8 =24. Write down 4, carry over 2.\n\n2*8=16, plus 2 is 18. So first partial product is 184.\n\nThen multiply 23 by 1 (tens place). Since it's the tens place, we shift one position to the left.\n\n3*1=3. Write down 3 in the tens place (but since we shifted, it's actually the hundreds place? Wait, maybe I need to be precise here.\n\nWait, actually, when you multiply by the tens digit (1 in 18), you have to multiply by 10, so the result should be shifted one place to the left. So:\n\nFirst, 3*1 =3, but since it's the tens place, that's 3*10=30. Then 2*1=2, which is 2*10=20. So adding those gives 30 +20=50? Wait, that doesn't seem right. Wait, maybe I confused the steps.\n\nAlternatively, when doing the multiplication step by step:\n\nAfter the first partial product (184), for the second digit (1 in 18's tens place), you write a zero as a placeholder in the units place, then multiply 1 by each digit of 23:\n\n1*3 =3 (tens place because of the shift), so write 3 in the tens column.\n\n1*2 =2 (hundreds place), so write 2 in the hundreds column. So the second partial product is 230. Then adding 184 +230:\n\n184\n\n+230\n\n------\n\nAdding units: 4+0=4\n\nTens: 8 +3=11, write 1, carry over 1.\n\nHundreds: 1 +2=3, plus the carried 1 is 4.\n\nThousands: nothing, so total is 414. That's correct.\n\nHmm, so all methods confirm that 18*23 is 414. Let me see if there's another way, maybe using doubling or something? For instance, 18 is 9*2, so 23*18 =23*9*2. Let's try that.\n\n23*9: 20*9=180, 3*9=27. 180+27=207. Then multiply by 2: 207*2=414. Yep, same answer. That works too.\n\nAlternatively, 23*20 would be 460, but since it's 18, which is 2 less than 20, so 23*20 =460, minus 23*2=46. So 460 -46 =414. That's another method. Let me verify:\n\n23*20 is indeed 460. 23*2 is 46. Subtracting 46 from 460: 460 -40=420, then -6=414. Correct again.\n\nSo multiple methods all lead to 414. I think that's solid. But just to be thorough, maybe do the addition in another way. Let's see, 184 +230. If I break 230 into 200 +30, then 184 +200 is 384, plus 30 is 414. Yep. Alternatively, 184 +230: 180 +230 =410, plus 4 is 414. All good.\n\nWait, maybe I can use the Russian peasant method? Let me recall how that works. It involves halving and doubling. Let me try.\n\nThe Russian peasant multiplication: you write the two numbers, and repeatedly halve one and double the other, adding the doubled number when the halved number is odd. Let's see.\n\nLet me take 18 and 23. Let's pick 18 as the one to halve, since it's even, maybe easier.\n\nSet up two columns:\n\n18 | 23\n\nWe'll halve 18 and double 23 until the left column is 1.\n\n18 is even, so we don't add 23 to the sum yet.\n\nHalve 18: 9, double 23:46\n\n9 is odd, so add 46 to the sum.\n\nNow, halve 9: 4.5, but since we need integers, maybe we stop at 1? Wait, perhaps I need to continue until the left number is 1. Let me check the exact steps.\n\nWait, actually, the process is:\n\nInitialize sum =0\n\nWhile the first number >0:\n\nIf the first number is odd, add the second number to the sum.\n\nHalve the first number (integer division)\n\nDouble the second number\n\nRepeat.\n\nSo starting with 18 and 23:\n\nFirst iteration:\n\n18 is even, so don't add 23 to sum.\n\nHalve 18: 9\n\nDouble 23:46\n\nSecond iteration:\n\n9 is odd, so add 46 to sum (sum=46)\n\nHalve 9:4\n\nDouble 46:92\n\nThird iteration:\n\n4 is even, don't add 92\n\nHalve 4:2\n\nDouble 92:184\n\nFourth iteration:\n\n2 is even, don't add 184\n\nHalve 2:1\n\nDouble 184:368\n\nFifth iteration:\n\n1 is odd, add 368 to sum (sum=46 +368=414)\n\nHalve 1:0\n\nDouble 368:736 (but since first number is now 0, we stop)\n\nTotal sum is 414. Perfect, that works too. So even using the Russian peasant method, I get 414. \n\nHmm, so all these different techniques are confirming the same answer. I think that's thorough. Maybe I can also use area model? Like, if I imagine a rectangle with length 18 and width 23, the area would be 18*23. But calculating that area by breaking into parts. For example, split 18 into 10 +8 and 23 into 20 +3. Then the area is (10+8)*(20+3) which is the same as the distributive method I did earlier, leading to 414. So that's consistent.\n\nAlternatively, maybe using known squares? Not sure if that applies here. 18 and 23 aren't close to each other or to squares, so maybe not helpful. Alternatively, 23 is 20 +3, so 18*20 +18*3 as before.\n\nAlternatively, using the fact that 18*23 = (20 -2)*23 =20*23 -2*23. 20*23 is 460, minus 46 is 414. Yep, same as before.\n\nI think I've tried multiple methods here and they all converge to 414, so I can be confident that's the correct answer. The key steps in the standard algorithm are breaking down the multiplication into partial products based on each digit, considering place value, and then adding them up. It's important to remember to shift the second partial product by one place because it's multiplied by the tens digit. Adding the two results carefully, making sure to handle carries properly, gives the final result. Cross-verifying with alternative methods helps ensure there's no mistake. So the step-by-step process using the standard multiplication algorithm would be:\n\n1. Write down the numbers vertically, aligning the digits by place value.\n\n2. Multiply the top number by the units digit of the bottom number, starting from the rightmost digit.\n\n3. Write down the partial product.\n\n4. Multiply the top number by the tens digit of the bottom number, shifting the result one place to the left (equivalent to multiplying by 10).\n\n5. Write down this second partial product.\n\n6. Add the two partial products together, starting from the rightmost digit and carrying over as needed.\n\nFollowing these steps for 18 × 23 gives 184 + 230 = 414.\n\nI don't see any errors in this process. All the cross-checks worked, so I think that's solid. Maybe if I had messed up a multiplication step, like 8×3 or 2×8, but 8×3 is 24, 2×8 is 16, which are correct. Then adding with the carry-over was done properly. The second partial product with the 1 in the tens place was correctly shifted. So yeah, 414 is the right answer.\n</think>\n\nTo compute \\(18 \\times 23\\) without a calculator, follow these steps using the standard multiplication algorithm:\n\n---\n\n### **Step 1: Set Up the Problem Vertically**\nAlign the numbers by their place values:\n\\[\n\\begin{array}{c}\n\\phantom{0}23 \\\\\n\\times 18 \\\\\n\\hline\n\\end{array}\n\\]\n\n---\n\n### **Step 2: Multiply by the Units Digit (8)**\n1. **Multiply 8 (units digit of 18) by each digit of 23:**\n   - \\(8 \\times 3 = 24\\).  \n     Write down **4** in the units place.  \n     Carry over **2** to the tens place.\n   - \\(8 \\times 2 = 16\\), plus the carried-over **2** gives **18**.  \n     Write down **18** in the tens and hundreds places.  \n   - **First partial product:** \\(184\\).\n\n\\[\n\\begin{array}{c}\n\\phantom{0}23 \\\\\n\\times 18 \\\\\n\\hline\n\\phantom{0}184 \\quad \\text{(from } 23 \\times 8\\text{)} \\\\\n\\end{array}\n\\]\n\n---\n\n### **Step 3: Multiply by the Tens Digit (1)**\n1. **Multiply 1 (tens digit of 18) by each digit of 23**, and **shift the result one place to the left** (equivalent to multiplying by 10):\n   - \\(1 \\times 3 = 3\\).  \n     Write down **3** in the tens place (shifted left, so it’s actually the hundreds place).\n   - \\(1 \\times 2 = 2\\).  \n     Write down **2** in the hundreds place (shifted left, so it’s actually the thousands place).  \n   - **Second partial product:** \\(230\\) (since \\(23 \\times 1 = 23\\), shifted left becomes \\(230\\)).\n\n\\[\n\\begin{array}{c}\n\\phantom{0}23 \\\\\n\\times 18 \\\\\n\\hline\n\\phantom{0}184 \\\\\n+\\phantom{0}230 \\quad \\text{(from } 23 \\times 10\\text{)} \\\\\n\\hline\n\\end{array}\n\\]\n\n---\n\n### **Step 4: Add the Partial Products**\nAdd \\(184\\) and \\(230\\):\n\\[\n\\begin{array}{c@{}c@{}c@{}c}\n\\phantom{0}1 & 8 & 4 \\\\\n+ & 2 & 3 & 0 \\\\\n\\hline\n\\end{array}\n\\]\n- **Units place:** \\(4 + 0 = 4\\).  \n- **Tens place:** \\(8 + 3 = 11\\). Write down **1**, carry over **1**.  \n- **Hundreds place:** \\(1 + 2 = 3\\), plus the carried-over **1** gives **4**.  \n\n**Final result:** \\(414\\).\n\n---\n\n### **Verification Using Alternative Methods**\n1. **Distributive Property:**  \n   \\(18 \\times 23 = (10 + 8)(20 + 3) = 10 \\times 20 + 10 \\times 3 + 8 \\times 20 + 8 \\times 3 = 200 + 30 + 160 + 24 = 414\\).\n\n2. **Breaking into Simpler Multiplications:**  \n   \\(18 \\times 20 = 360\\) and \\(18 \\times 3 = 54\\).  \n   \\(360 + 54 = 414\\).\n\n3. **Russian Peasant Method:**  \n   Halve and double repeatedly:  \n   - \\(18 \\times 23 = (9 \\times 2) \\times 23 = 9 \\times 46 = (4 \\times 2) \\times 46 + 46 = 8 \\times 92 + 46 = \\dots = 414\\).\n\n---\n\n### **Final Answer**\n\\[\n\\boxed{414}\n\\]",
        "reasoning_content": null,
        "tool_calls": null
      },
      "logprobs": null,
      "finish_reason": "stop",
      "matched_stop": 100257
    }
  ],
  "usage": {
    "prompt_tokens": 40,
    "total_tokens": 3707,
    "completion_tokens": 3667,
    "prompt_tokens_details": null,
    "reasoning_tokens": 0
  },
  "metadata": { "weight_version": "default" }
}

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@vincentzed vincentzed marked this pull request as ready for review November 20, 2025 20:03
Signed-off-by: Vincent Zhong <[email protected]>
Signed-off-by: Vincent Zhong <[email protected]>
Signed-off-by: Vincent Zhong <[email protected]>
@vincentzed vincentzed force-pushed the vz/olmo3-reasoning-day0 branch from 63f187c to 3f032a7 Compare November 20, 2025 20:50
@JustinTong0323
Copy link
Collaborator

Why we can't reuse qwen3detector?

@vincentzed
Copy link
Contributor Author

Why we can't reuse qwen3detector?

It is the case that

Olmo models use and string to bracket their reasoning traces; however, unlike Qwen or Deepseek families, the strings are not special tokens in the vocabulary, therefore requiring a new parser.

@JustinTong0323
Copy link
Collaborator

JustinTong0323 commented Nov 21, 2025

I do think it could work for non-special tokens? As I did similar thing for kimi-vl thinking, could you check that again? The current implementation is too complicated for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants