YouTube2Text

Bonsai 27B Deep Dive – 1-Bit, Ternary & Full Precision Compared! — Transcript

by Bijan Bowen · 6,266 words · 962 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Okay, nothing now.
  2. 0:05I'm done.
  3. 0:06Today we're going to be taking a look at
  4. 0:08the newly released Bonzai 27 billion
  5. 0:11parameter models, which are very
  6. 0:13interesting. Now, these come from Prism
  7. 0:15ML, and I have covered some of their
  8. 0:17models before in this Bonzai family. And
  9. 0:19essentially, what these are are massive
  10. 0:21reductions in size of the original
  11. 0:23models that they are based off off of,
  12. 0:26in this case being a Qwen 3.6 27B that
  13. 0:29has been shrunk down a couple of
  14. 0:30different ways, depending on what
  15. 0:32specific target device you would like
  16. 0:34this to be deployed on. So, in this
  17. 0:36announcement post, they mentioned both
  18. 0:38running this on a computer, whether it
  19. 0:40be a Linux computer, PC, or whatever, or
  20. 0:42a Mac. Additionally to that, they also
  21. 0:45talk about running these on phones.
  22. 0:46Specifically, they do mention for an
  23. 0:48iPhone 17 Pro, it is able to be run on
  24. 0:52at decent speed. I do have this running
  25. 0:54currently on an Asus ROG Phone something
  26. 0:56Pro. So, we're going to not only be able
  27. 0:58to check the performance of the one that
  28. 1:00is designed to run on a PC, but also the
  29. 1:03one that is running on a phone. As a
  30. 1:05matter of fact, I do have both of those
  31. 1:07set up and spinning right here. So, this
  32. 1:08one is the one that is running on a PC,
  33. 1:10as we could probably guess by the token
  34. 1:12speed. And this tab right here is the
  35. 1:14one that's running on the mobile phone.
  36. 1:16So, it's actually kind of cool to be
  37. 1:18able to talk to something through the
  38. 1:19web chat interface right here of Llama
  39. 1:21server, actually knowing it's running on
  40. 1:23my mobile phone sitting next to the
  41. 1:25laptop. So, before we get into it,
  42. 1:26please do feel free to subscribe so I
  43. 1:28can get that 100K plaque. And with that,
  44. 1:30let's begin just by taking a quick look
  45. 1:32at the options that we have for today in
  46. 1:34terms of these Bonzai models. So, Bonzai
  47. 1:3727B comes in two variants. The first is
  48. 1:40a ternary Bonzai 27B, and that is the
  49. 1:43one that is running right here in this
  50. 1:44tab on port 8080 at 65 or so tokens per
  51. 1:48second. And that is a smarter but larger
  52. 1:50version of the Bonzai model right here,
  53. 1:53where it uses ternary weights with FP16
  54. 1:56group wise scaling, giving a true 1.71
  55. 1:59effective bits per weight. At 5.9 GB,
  56. 2:03this is the quality-oriented
  57. 2:05quality-oriented variant. It runs on an
  58. 2:07everyday laptop with full reasoning,
  59. 2:09tool calling, and agentic capability.
  60. 2:11So, when doing some comparisons, we will
  61. 2:13really mainly want to see how this
  62. 2:15specific one, the ternary, stacks up
  63. 2:17with the FP16 version of the model it's
  64. 2:20based on, Qwen 3.6 27B. The next model
  65. 2:23version for this Bonsai 27B is the
  66. 2:261-bit, and this is the one that is going
  67. 2:28to be running on the mobile phone, which
  68. 2:30we can see is at port 8081 here, and
  69. 2:32running a bit slowly. However, this uses
  70. 2:35binary weights with the same group-wise
  71. 2:37scaling, giving an effective 1.125 bits
  72. 2:41per weight at 3.9 GB. So, that is a
  73. 2:43massive size reduction when considering
  74. 2:46that the full weights for the Qwen model
  75. 2:48it is based on are, as they say right
  76. 2:50here, 54 GB or somewhere around there.
  77. 2:53So, this can fit within the memory
  78. 2:55budget of an iPhone 17 Pro, bringing a
  79. 2:5727 billion parameter class model onto a
  80. 3:00phone for the first time. I don't know
  81. 3:01if I'd say first time just based off of
  82. 3:03this Xpost I made a few months ago, but
  83. 3:05nonetheless, I am just being a bit
  84. 3:07sarcastic. So, I I don't want to get
  85. 3:09into like a big technical deep dive on
  86. 3:11how these work, because they're very
  87. 3:12complex and I don't know how much
  88. 3:13service I would do in trying to explain
  89. 3:15that. I will say, however, at the bottom
  90. 3:17of this announcement post right here,
  91. 3:19they do have a link to their white
  92. 3:20paper, which will open it for you in
  93. 3:22GitHub, and you can go through and take
  94. 3:23a peek at it. It has a lot more
  95. 3:25intricate information. No, the actual
  96. 3:27methodology that they're using
  97. 3:29specifically to reduce the size of these
  98. 3:31models is not open source. So, just make
  99. 3:34note of that as well, but it does tell
  100. 3:35you some more pertinent information
  101. 3:37about everything that's going on here.
  102. 3:39Additionally, just to quickly touch upon
  103. 3:41it, and I'm maybe a little rusty, but
  104. 3:43from my recollection of doing some
  105. 3:45videos pertaining to their models
  106. 3:46before, essentially, the weights are
  107. 3:49shrunk down in in of 128, whether it be
  108. 3:51ternary or binary, and then that group
  109. 3:54of 128 weights has like a block-wise
  110. 3:56scaling factor that is FP16, I believe
  111. 3:59is the case. Again, don't quote me on
  112. 4:01that 100%, but basically they take like
  113. 4:03groups of 128 weights, and they become
  114. 4:06either ternary or binary depending on
  115. 4:08which specific model it is. And then a
  116. 4:10group of 128 weights gets like a scaling
  117. 4:13factor applied to them that is a higher
  118. 4:15precision than ternary or binary. Um
  119. 4:18something like that. Now, the models are
  120. 4:20available on Hugging Face in a number of
  121. 4:22different formats, and they do have some
  122. 4:23additional interesting things to note
  123. 4:25here. They have shipped this with a
  124. 4:27compatible speculative decoding setup as
  125. 4:29well, so that will speed up, as we see
  126. 4:31right here, 1.34 times decoding speed on
  127. 4:33the CUDA serving path. Additionally,
  128. 4:35they have paid respect to MLX, so Apple
  129. 4:38devices also have compatibility. Now,
  130. 4:40there's some interesting things
  131. 4:41contained here within the Hugging Face
  132. 4:43model card as well, because I find with
  133. 4:45these models, sometimes it can be
  134. 4:47confusing because it's like, "Okay,
  135. 4:48well, if the model's 5.9 GB, then if I
  136. 4:51open NVTop right here, why is my
  137. 4:53computer using 10.7 GB to serve this
  138. 4:56model right now?" And they mention that
  139. 4:59and explain it a couple of different
  140. 5:00ways. So, one of those is the kernel is
  141. 5:03storing the ternary values in a bit
  142. 5:05larger than what would be the ideal
  143. 5:07size, which is that 5.9 GB.
  144. 5:09So, the deployed size they say is around
  145. 5:117.2 GB. Following that, and additionally
  146. 5:14in terms of why this is using a bit more
  147. 5:16weight or VRAM than one would expect
  148. 5:19even with the deployed size, they do
  149. 5:21have a chart here just showing the
  150. 5:22actual memory footprint of this deployed
  151. 5:25over a number of different context
  152. 5:26lengths. So, we can see that 10K
  153. 5:28contexts with this model that we're
  154. 5:30running right here would be around 8.7
  155. 5:32GB of VRAM, and 100 would go up to 14.7.
  156. 5:35So, keep that in mind, and if you wanted
  157. 5:37to run this at absolutely full context
  158. 5:39of 262K and change, it would go up even
  159. 5:43higher than that. So, keep that in mind
  160. 5:45that these are not going to be using
  161. 5:47that 6 gigs of VRAM to run this 27B
  162. 5:50model, but it's a
  163. 5:53step closer to getting there. So, I want
  164. 5:55to do a really proper comparison test to
  165. 5:57showcase these models because a lot of
  166. 5:59folks, the interest is going to be in
  167. 6:01how well do these actually stack up to
  168. 6:03the original full precision version of
  169. 6:05this model. So, in this tab right here,
  170. 6:07we are running the binary version of the
  171. 6:09model. This is running entirely on a
  172. 6:11mobile phone that is just attached to
  173. 6:13this computer just so I can get power
  174. 6:15and things like this. Given a very
  175. 6:17simple prompt. Now, in the middle tab
  176. 6:19right here, this is running on the
  177. 6:21laptop that I'm using to control this
  178. 6:24entire demo. This is a 5090 mobile and
  179. 6:27this is using the ternary version of
  180. 6:29this model. So, the more performant one
  181. 6:31as we see right here, that is the
  182. 6:33ternary that is used in the middle tab
  183. 6:35and it is the binary that is used in the
  184. 6:38left most tab. Now, all the way in the
  185. 6:40right, this is running the full
  186. 6:41precision version of this model. It's
  187. 6:43not quantized or anything and this is
  188. 6:45running on a 6000 Pro Blackwell just on
  189. 6:48the computer behind me. So, we're going
  190. 6:50to be able to see proper side-by-side
  191. 6:52results for the two Bonsai versions of
  192. 6:55this model as well as the full-blown
  193. 6:57full precision original model. That way
  194. 6:59we can just get some more educational I
  195. 7:01suppose value out of seeing these
  196. 7:03demonstrations. Now, for this first
  197. 7:05test, I have disabled reasoning for all
  198. 7:07of these because the mobile phone one is
  199. 7:09extremely slow. The one running on the
  200. 7:12Blackwell is not super slow, but it can
  201. 7:14end up taking quite a while and then the
  202. 7:16one running on this computer right here
  203. 7:18is rather quick and I'm not using the
  204. 7:20MTP
  205. 7:21thing that is included with it. So, that
  206. 7:23would speed things up a bit, but for now
  207. 7:25we're just going to see the results we
  208. 7:26get for a simpler Steve's PC Repair
  209. 7:29website. All right, so all of our simple
  210. 7:31website comparisons have concluded. I do
  211. 7:33have to say I somewhat regret opting to
  212. 7:36run the one-bit binary off of a phone
  213. 7:38because that took a little under 3 hours
  214. 7:40to generate this website
  215. 7:42At the highest total token count for
  216. 7:44this result, so it was an overall speed
  217. 7:47of 1.56 tokens per second. Perhaps let's
  218. 7:49not focus too heavily on the speed
  219. 7:51metric there um for that specific phone
  220. 7:53and that specific model. Nonetheless, we
  221. 7:55have our ternary version in the middle
  222. 7:58tab, which took 4 minutes and 23 seconds
  223. 8:00at a speed of 58.68 tokens per second on
  224. 8:03a 5090 mobile not using the additional
  225. 8:06draft model that they have for this.
  226. 8:08Then finally, we have the full-fledged
  227. 8:10full precision version, which ran at
  228. 8:1228.73 tokens per second on a Blackwell
  229. 8:15RTX 6000 Pro, not the Max-Q like the
  230. 8:19full non-power limited one. And that was
  231. 8:22significantly less tokens, so I need to
  232. 8:24make sure everything's all set here with
  233. 8:25the sampling parameters. But
  234. 8:27nonetheless, I do have these all saved,
  235. 8:28so let's take a look at them. So, let's
  236. 8:30just start with the binary one as we
  237. 8:33want to I guess get a feel for the
  238. 8:34smallest first.
  239. 8:36That's
  240. 8:37honestly
  241. 8:38not bad for a one-bit binary version.
  242. 8:41This is actually decently aesthetically
  243. 8:43pleasing. Yes, there's some oddities to
  244. 8:45it such as the randomly scattered around
  245. 8:47things. Trusted by 10,000 plus clients.
  246. 8:50That's quite impressive. We do have
  247. 8:51hover effects on the buttons. And did
  248. 8:53you see the way these metrics actually
  249. 8:55had effects in terms of when they
  250. 8:57reached their final number? That's
  251. 8:59actually pretty good. We do have hover
  252. 9:00effects on these cards.
  253. 9:03Steve's PC repair, 15 years expert, and
  254. 9:05that would ideally be a photo of Steve.
  255. 9:08Book an appointment, how we fix your PC,
  256. 9:10what our clients say, transparent
  257. 9:12pricing. Not bad. These pricing cards do
  258. 9:14look quite good. Ready to get your PC
  259. 9:16fixed. And we have a nice clean
  260. 9:18good-looking contact card. And the
  261. 9:21footer's very well done, too. All right,
  262. 9:23so that's
  263. 9:24That's kind of cool. I mean, like this
  264. 9:25entire thing was generated just using a
  265. 9:27mobile phone running the binary version
  266. 9:30of this model, which is quite awesome.
  267. 9:33Nonetheless, let's take a look now at
  268. 9:36the ternary one, which was like the
  269. 9:37middle tab, the middle intelligence to
  270. 9:40size one.
  271. 9:42Okay. Ooh.
  272. 9:44And we'll notice that throughout this,
  273. 9:45there going to be similarities because
  274. 9:47it's the same model, but there are
  275. 9:49differences in like how hard it goes.
  276. 9:51This one's only trusted by 2,000 clients
  277. 9:54as opposed to 10,000 plus, so this Steve
  278. 9:56is a smaller business. We do actually
  279. 9:58have some interactive particle effects
  280. 10:00in the background.
  281. 10:01Hover effects here and a more kind of
  282. 10:03neon like synthwave aesthetic, which I
  283. 10:06personally am a big fan of. Okay, our
  284. 10:08pricing cards Oh, no, these are just
  285. 10:10services and their specific prices. Not
  286. 10:13bad, good hover effects, and they all
  287. 10:14have some nice transparency to them.
  288. 10:16About us, okay, established 2009. All
  289. 10:19right, I don't know why this just came
  290. 10:21to mind, but like a random like side
  291. 10:22note,
  292. 10:23back a long time ago, I used to think
  293. 10:25this EST meant like estimated, and I
  294. 10:28would always be like, how do they not
  295. 10:30know like the date these businesses were
  296. 10:31created? And I realized that it meant
  297. 10:33established. So, that clarified that for
  298. 10:36me. Just, you know, little
  299. 10:37um side note. Okay, we have a
  300. 10:39good-looking same simple repair process.
  301. 10:42I'm looking to see if there's a good
  302. 10:43aesthetically pleasing pricing card like
  303. 10:45we got with the binary version. We do
  304. 10:48have fake customer testimonials. Very
  305. 10:50good.
  306. 10:51Okay, no, and it just goes down to a
  307. 10:53contact card. Interesting though,
  308. 10:55there's no And the footer looks good and
  309. 10:57everything. Designed with love and
  310. 10:59coffee. The other one was designed with
  311. 11:00love and solder. Now, finally, and
  312. 11:03again, I do need to check the sampling
  313. 11:04parameters because this one was so
  314. 11:06suspiciously smaller in terms of overall
  315. 11:08generation length than the other two.
  316. 11:10Oh, goodness.
  317. 11:12Okay. So, this is the full precision
  318. 11:14one. Steve's PC repair, system
  319. 11:16optimized, initiate repair. Good hover
  320. 11:19effect.
  321. 11:20Service modules. Okay. And they all have
  322. 11:23a similar kind of thing. 2K systems
  323. 11:25fixed. So, this one has the same stats
  324. 11:27as the ternary one. Okay, now, something
  325. 11:29There's no way. Something has to be
  326. 11:32a bit off here because
  327. 11:34the full precision one should have not
  328. 11:36been this bad. All right, next up I have
  329. 11:38enabled thinking for all of these and I
  330. 11:40do believe that the behavior we saw
  331. 11:42where the full precision version of the
  332. 11:44model was actually a much shorter
  333. 11:45script. I think that's behavioral
  334. 11:48because we had thinking off. So, it is
  335. 11:49possible that the bonsai models as part
  336. 11:52of the way they're trained in order to
  337. 11:54retain their intelligence are given like
  338. 11:56front-end examples that have a lot of
  339. 11:59aesthetically pleasing things in them
  340. 12:01and that could be attributed to why
  341. 12:03those were so much longer. Nonetheless,
  342. 12:05don't quote me on that, but I just
  343. 12:06wanted to give some at least thought on
  344. 12:08whether or not that was
  345. 12:10normal behavior or not. So, now with
  346. 12:12thinking on I would imagine we will
  347. 12:14begin to see hopefully some more
  348. 12:15difference in the favor of the full
  349. 12:17precision model here, but nonetheless,
  350. 12:19this is a bit more difficult and will
  351. 12:20give us some more interesting demos.
  352. 12:23This is of course a 3D subway station
  353. 12:25first-person shooter test. Now, the
  354. 12:27binary and ternary are both being run on
  355. 12:30this 5090 mobile laptop. So, if the
  356. 12:32speeds are not as fast, it's because
  357. 12:34this is handling both of these here at
  358. 12:35the same time. And then the full
  359. 12:37precision is being run on the 6000 Pro
  360. 12:40Box. So, we'll
  361. 12:42get our results at some point. I'm happy
  362. 12:44to see though and something I was a
  363. 12:45little worried about is whether or not
  364. 12:46the smaller models would be inclined to
  365. 12:49just overthink massively. Fortunately,
  366. 12:51we didn't see that. The reasoning was
  367. 12:52actually fairly concise and that's
  368. 12:54always definitely a risk. I do believe
  369. 12:57when
  370. 12:58Okay, I just saw you're dead. Okay,
  371. 13:00that's good.
  372. 13:01It's good to see that these didn't
  373. 13:02overthink massively. All right, let's
  374. 13:04start with the binary subway FPS. Okay,
  375. 13:06subway station survive the infestation.
  376. 13:09Now, the mouse disappears as soon as it
  377. 13:11gets on the page. Sometimes when this
  378. 13:13happens, we just need to find the enter
  379. 13:15station button and it will still let us
  380. 13:17in.
  381. 13:19So, we'll hold off on that.
  382. 13:21Let's just take a look at the ternary
  383. 13:23version model versions. Okay, subway
  384. 13:26station zombies. Same weird cursor
  385. 13:28glitch issue.
  386. 13:29And the same complete failure of the
  387. 13:32start button actually doing anything at
  388. 13:34all. Okay, well, this is going quicker
  389. 13:36than I anticipated. Finally, let's try
  390. 13:38the
  391. 13:40the full precision version and hope that
  392. 13:42it's not a disaster like those.
  393. 13:46Are you
  394. 13:48Oh, okay. All right, so yes, this is
  395. 13:51makes a bit more Wow, this is quite
  396. 13:53good.
  397. 13:54This model is really like a just
  398. 13:58punches above its weight to a very high
  399. 14:00degree.
  400. 14:01At least in my testing.
  401. 14:03Okay, we're getting some lag pretty bad,
  402. 14:04but that's okay. This computer does have
  403. 14:06about like 20 gigs of VRAM hold up right
  404. 14:09now. Okay, so this is the only one that
  405. 14:12actually worked. Definitely showing us
  406. 14:14some
  407. 14:16differences. Actually, look at these
  408. 14:18like these models are not even that bad.
  409. 14:22This model never fails to amaze. There
  410. 14:25are rumors that there could be like a
  411. 14:26Qwen 3.8 coming out. Don't quote me on
  412. 14:28that, but that'd be really exciting for
  413. 14:30the local enthusiast among us. Good. All
  414. 14:33right. So,
  415. 14:35let's take a look and see what specific
  416. 14:36errors these are having. Okay, so that
  417. 14:38just has a syntax error and that was the
  418. 14:41ternary one. Let's check the binary one.
  419. 14:44That also has a syntax error as well.
  420. 14:46So, both of them just kind of weren't
  421. 14:49all there together and the
  422. 14:5116-bit obviously was. All right, next up
  423. 14:54we're going to try some
  424. 14:56agentic coding with these models because
  425. 14:58I want to see what we get for that. And
  426. 15:01I think that's going to show a bit more
  427. 15:03insight beyond just the single file like
  428. 15:05zero-shot generations that we're doing,
  429. 15:07even though those are fun. However, I am
  430. 15:09going to base our agentic coding test
  431. 15:12just on the errors that these two
  432. 15:13models, the binary and ternary, have for
  433. 15:15the subway FPS test. So, we're I'm going
  434. 15:18to give them the specific error that is
  435. 15:20showing up for either of their
  436. 15:21respective generations starting with the
  437. 15:23binary model where we have this uncaught
  438. 15:26syntax error and we'll see what it does.
  439. 15:28I need to change it. That is currently
  440. 15:30the ternary. So, if we go into models, I
  441. 15:32do have the configs all set up here.
  442. 15:35And I'm specifically not telling it
  443. 15:37in what script because it's in the
  444. 15:39dedicated directory which only the
  445. 15:41script is in. So, that's kind of an
  446. 15:43additional test is to see if it
  447. 15:44understands, okay, I need to fix this
  448. 15:46issue that's happening in the script
  449. 15:47that is in the directory I'm being run
  450. 15:49from within. Ignore the Q1 lingo there.
  451. 15:52It's not necessarily accurate for the
  452. 15:54way we're representing this.
  453. 15:57Found the issue on line 953. There's
  454. 15:59Okay, and then it changed it before.
  455. 16:02Yeah, all right. That would
  456. 16:04That's likely going to do it assuming
  457. 16:05that there are no more errors beyond
  458. 16:07this one. Okay, it's compacting a lot.
  459. 16:10It's running at 64K context length, but
  460. 16:12for now we're going to just assume
  461. 16:14because it does seem like it actually
  462. 16:15did remedy that one issue.
  463. 16:18Okay, so we have another one
  464. 16:19unfortunately.
  465. 16:20But it did fix the issue that was
  466. 16:22happening at least in that it's no
  467. 16:23longer appearing here. All right, so
  468. 16:25I've changed it so the context length is
  469. 16:27maxed out to 262144
  470. 16:30and I'm opening it back up from the same
  471. 16:32directory within the same model and I'm
  472. 16:34giving it the new error that it has
  473. 16:36received here and we'll see. My fear is
  474. 16:39that we may just
  475. 16:41have a bunch of errors to get through
  476. 16:42going back and forth where it will fix
  477. 16:44one like it did before and then another
  478. 16:46one will pop up and then we'll have to
  479. 16:47fix that. But nonetheless, we'll give it
  480. 16:48some time to see if we can get this to a
  481. 16:50functional point. That was very quick.
  482. 16:52So, let's refresh it.
  483. 16:54Okay, we do have another one and like I
  484. 16:57said, I do have some concern that it may
  485. 16:59just end up
  486. 17:01being a bunch of this, but we'll push it
  487. 17:03till we can't anymore.
  488. 17:05I will say even if we don't get this to
  489. 17:07a functional point, it is
  490. 17:09inspiring to see that it's seeing these
  491. 17:11errors and quickly fixing them and it's
  492. 17:13not getting stuck in loops or
  493. 17:15overthinking massively which I find to
  494. 17:17be pretty impressive.
  495. 17:19Okay?
  496. 17:25Okay, we're not getting any errors.
  497. 17:30Good. It got us to a point where we are
  498. 17:33actually in the game. Now, yes, it's not
  499. 17:35working fully and we're getting more
  500. 17:36errors now, but the thing is it got us
  501. 17:38past that first blocker, which I'm happy
  502. 17:41about. So, I'm going to continue just
  503. 17:42pasting these errors in. Ideally, I
  504. 17:44think the best thing to do would be to
  505. 17:45tell it like, "Okay, listen, I'm sick of
  506. 17:47pasting these errors in. I need you to
  507. 17:48build a little pipeline for yourself so
  508. 17:50you can autonomously pull these errors
  509. 17:52from developer tools, fix them, and then
  510. 17:54test again, and then fix, and then keep
  511. 17:56iterating until it doesn't give us
  512. 17:58errors anymore." No errors yet.
  513. 18:02Okay. So, it seems like this may be
  514. 18:05where we end with this. Where if we
  515. 18:08actually restart it, look up at the top
  516. 18:10right, and let me close the developer
  517. 18:11tools for now. You're going to see our
  518. 18:13ammo starts at 50, and if I turn the
  519. 18:15speaker up all the way, and I click, it
  520. 18:17will go down to 49, and we'll hear a
  521. 18:19sound.
  522. 18:21Unfortunately, then after that, nothing
  523. 18:23seems to happen. Nonetheless, it did
  524. 18:25take us to a point where it fixed all of
  525. 18:27the issues, and the ones that are left
  526. 18:28over are issues in actual like
  527. 18:31implementation of the game, and not
  528. 18:33things that are going to be shown to us
  529. 18:35just from the developer tool console
  530. 18:36there. So, I'm satisfied with what I saw
  531. 18:39there, and the fact that it did actually
  532. 18:40handle a bunch of different errors from
  533. 18:42within the same thread, and didn't freak
  534. 18:44out and didn't start overthinking. It
  535. 18:46fixed them all one by one, which I think
  536. 18:48considering like what this is is rather
  537. 18:50impressive. All right, next up I have
  538. 18:51the ternary model loaded in through Open
  539. 18:53Code here, and this is with a 131 in
  540. 18:55change context length, because um
  541. 18:58getting it to the full one, I don't
  542. 19:00think will be necessary here.
  543. 19:01Additionally to that, it also would just
  544. 19:03tap out the card. I have neglected to
  545. 19:05actually tell it like, "Fix this error."
  546. 19:08I just ended up pasting it in, but it's
  547. 19:09the same situation where it's only in a
  548. 19:11repository with the specific script it
  549. 19:13created here. So, it will very likely
  550. 19:15understand, "Okay, I need to figure this
  551. 19:16out based off of what's in this
  552. 19:18repository or folder, I should say."
  553. 19:20Found the bug and fixed it. I would
  554. 19:22assume we'll have a couple more,
  555. 19:24probably. I need to remember that I
  556. 19:26moved the folders.
  557. 19:28Okay, nothing now.
  558. 19:34I'm done.
  559. 19:35>> [laughter]
  560. 19:37[snorts]
  561. 19:37>> Well, that was unpleasant. So, all
  562. 19:39right. I mean, yes, we Oh, wow. Okay. Uh
  563. 19:44yeah, I'm just going to
  564. 19:46I'm just going to paste that in because,
  565. 19:47quite frankly, I don't even have the
  566. 19:48words to describe the specific issue
  567. 19:51here without probably using language
  568. 19:53that is not appropriate for this
  569. 19:54platform. So, we'll see what happens
  570. 19:56here.
  571. 19:59Nonetheless, it did have one specific
  572. 20:00error and then it fixed it. And we did
  573. 20:03get the game working. So, a quicker and
  574. 20:05more
  575. 20:06complete result than we saw with the
  576. 20:08binary. Um also more jarring and
  577. 20:11stress-inducing. All right,
  578. 20:12unfortunately, we've seemingly just hit
  579. 20:14a bit of an impasse here. Nonetheless, I
  580. 20:16was satisfied with what we saw because
  581. 20:18it did fix the one error that was
  582. 20:19blocking it from actually showing us the
  583. 20:21game, and the game was a bit more um
  584. 20:24playable than
  585. 20:26the
  586. 20:27one-bit one. So, it was This was very
  587. 20:30proper in terms of showcasing like the
  588. 20:33one-bit was just didn't really do
  589. 20:35anything. The ternary kind of worked,
  590. 20:37and then the full-precision one was
  591. 20:39arguably fantastic considering the size.
  592. 20:41So, uh interesting, and I wanted to
  593. 20:43throw in some agentic coding there just
  594. 20:45at least for the binary and ternary ones
  595. 20:47to see if they can handle open code, and
  596. 20:50they could. All right, so, the next
  597. 20:51thing I did is a bit different, but I
  598. 20:52know folks have often times, especially
  599. 20:54for models like this, wanted to know how
  600. 20:56they do with existing code bases. So, I
  601. 20:59gave them each access to a simple
  602. 21:01diffusion demo that I have where it's
  603. 21:04essentially a 3D model of a keyboard,
  604. 21:06and a small trained diffusion model
  605. 21:07predicts out of potential keyboard
  606. 21:10layouts like QWERTY, Dvorak, et cetera.
  607. 21:12I had to use that for my Gemini
  608. 21:14diffusion model video. So, the prompt
  609. 21:16here was essentially to give these each
  610. 21:19some questions about this specific code
  611. 21:21base in an isolated copy via open code
  612. 21:23with identical sampling parameters and
  613. 21:25ask them some targeted questions about
  614. 21:27this repo and then just grade how they
  615. 21:30did in terms of their quality and depth.
  616. 21:32So, apparently they all passed five of
  617. 21:34five. However, we do have some more
  618. 21:36fine-grain detail in terms of the actual
  619. 21:38specific questions that were asked and
  620. 21:40where things started to fall apart in
  621. 21:42terms of like
  622. 21:44wrong answers. So, let's just go through
  623. 21:46our per question details. So, question
  624. 21:48one was to describe the full training to
  625. 21:50browser pipeline and what happens if the
  626. 21:52exported weights fail verification. Then
  627. 21:55we have our expected answer right here.
  628. 21:58Reports the failure in the HUD and the
  629. 21:59demo keeps running on exact analytic
  630. 22:01base. So, exactly there was a fallback
  631. 22:04there where it would just kind of fake
  632. 22:05what would happen were there a properly
  633. 22:07trained model and that is the answer
  634. 22:09we're looking for. Complete chain with
  635. 22:11correct line numbers also identified the
  636. 22:13separate fetch failure fallback path
  637. 22:15beyond the rubric. So, that is the full
  638. 22:17precision version of the Qwen 27B model.
  639. 22:20The ternary version complete chain
  640. 22:23including exact HUD failure message and
  641. 22:25no wrong predictions just a fallback
  642. 22:27called the JS engine a 200 line source
  643. 22:29comments as 100 trivial and then binary
  644. 22:32correct chain and threshold for the
  645. 22:34maximum error. Correct fallback least
  646. 22:36detail on what the UI reports. So, all
  647. 22:38of these did actually get that correct,
  648. 22:40which is cool to see. So, question two,
  649. 22:42exactly how many training sequences,
  650. 22:44what are they and how is a batch of 64
  651. 22:46built? The expected answer is exactly
  652. 22:49four sequences, the 40 character layout
  653. 22:51strings sampled with replacement via
  654. 22:53torch random integer to 64 rows. Each
  655. 22:56row independently gets up to this per
  656. 22:58position masking with a probability of
  657. 23:00this masked position enforced. So, our
  658. 23:02BF16 got quoted all four exact strings,
  659. 23:06described clamp subtly wrong. The clamp
  660. 23:08creates a point mass here, not uniform,
  661. 23:10only modeled to make that claim
  662. 23:12precisely enough to be wrong.
  663. 23:13Interesting. Ternary, quoted all four
  664. 23:16exact strings, noted one mass guard and
  665. 23:19one T waiting, didn't mention the clamp.
  666. 23:21Okay.
  667. 23:23Then again, these are I mean, this is
  668. 23:24not necessarily my favorite way of
  669. 23:26measuring things, but it is important
  670. 23:28for models like these just to see.
  671. 23:29Binary, named the four layouts, didn't
  672. 23:31quote the strings, got with replacement
  673. 23:34sampling, mass guard. Okay. So, they all
  674. 23:37overall got that kind of correct, which
  675. 23:39is cool, but it was interesting that it
  676. 23:40mentioned the full precision one only
  677. 23:42model to make that claim precisely
  678. 23:44enough to be wrong. Question three, why
  679. 23:46is probs for recomputed inside the
  680. 23:48commit loop? What breaks without it and
  681. 23:50where does the JS handle it? Expected
  682. 23:53ancestral sampling, each committed token
  683. 23:55must condition subsequent value
  684. 23:56sampling. The model is bidirectional,
  685. 23:59refusing steps hard marginals, let's
  686. 24:01position sample from incompatible
  687. 24:02layouts, incoherent output and the demos
  688. 24:04exact posterior zeros out. JS
  689. 24:06counterpart and then we have some
  690. 24:08additional info right here.
  691. 24:10BF16, textbook answer, correct
  692. 24:12citations. Good, named commit key
  693. 24:14explicitly. Ternary, correct mechanism
  694. 24:17and named commit key uniquely added that
  695. 24:19disk cache is keyed on committed state,
  696. 24:22so self invalidates. True and beyond the
  697. 24:24rubric, but cited lines 304 for commit
  698. 24:26key and line 217 elsewhere, wrong
  699. 24:29locations. Then binary, correct concept
  700. 24:32with a concrete two-position example,
  701. 24:33identified the JS mechanism, but never
  702. 24:36named commit key. So, we see different
  703. 24:38levels. Interesting, the ternary one
  704. 24:39there seems to
  705. 24:41be like fairly robust, even if it got
  706. 24:44some line numbers wrong. So, question
  707. 24:46four, every mechanism that keeps mask
  708. 24:48out of the generated output and then the
  709. 24:49expected, we have a bunch of Python
  710. 24:51information here and then what specific
  711. 24:53like math would
  712. 24:55cause that to happen. Skips mask ID in
  713. 24:57the soft max and only enumerates real
  714. 24:59chars real characters. Bonus the
  715. 25:01analytic base path can only propose
  716. 25:03layout characters by construction. BF16
  717. 25:06all required guards with correct lines
  718. 25:08plus the analytic path bonus cleanest
  719. 25:10answer of the five questions. Ternary
  720. 25:12both required guards correct extra
  721. 25:14claims about top of commit flow correct
  722. 25:16in substance but wrong line numbers
  723. 25:18again. Interesting that it seems to be a
  724. 25:20consistent thing here that it's getting
  725. 25:21the wrong line numbers. Then finally
  726. 25:23binary both required guards correct but
  727. 25:26credited posterior from is guard that
  728. 25:28function computes the layout posterior
  729. 25:30not character distributions. The
  730. 25:32analytic character path lives in get
  731. 25:33distributions misattribution. Okay. Then
  732. 25:36finally
  733. 25:37question five Why can the layout
  734. 25:39posterior panel disagree with hover tool
  735. 25:41tips when the net is active? Expected
  736. 25:43the panel always computes the exact
  737. 25:45analytic base posterior from as ground
  738. 25:48truth. Tool tips ghosts use get
  739. 25:49distributions which switches to the
  740. 25:51train net. The disagreement is the point
  741. 25:53comparing the net equals base. All
  742. 25:55right. So BF16 complete correct
  743. 25:57citations and articulated the layout
  744. 25:59level versus character level distinction
  745. 26:01plus what divergence reveals. Ternary
  746. 26:03complete correctly traced the net base
  747. 26:06commit comment to sample.py. Good
  748. 26:09framing of learned approximat
  749. 26:11approximation versus exact reference.
  750. 26:13Binary correct and concise cited the
  751. 26:15design comment line 90 actually 89 but
  752. 26:18trivial. Okay. Pretty interesting. They
  753. 26:20actually seem to perform fairly strong
  754. 26:22on this. Now this is not a
  755. 26:24super complicated code base. I mean if
  756. 26:27we look at it right here it is in the
  757. 26:28diffusion folder. We can see there's not
  758. 26:30too much to it but it is a tiny little
  759. 26:32diffusion model trained to predict the
  760. 26:34layouts of a keyboard based off of like
  761. 26:36potential ones that appear. Then it
  762. 26:38re-masks and then it makes new guesses
  763. 26:40based off of what's been unmasked and
  764. 26:42things like diffusion. So it's not
  765. 26:44necessarily like a super trivial like 3
  766. 26:46JS scene or front end or something of
  767. 26:48the sort. So that's cool to see. Then we
  768. 26:50have some information about how they
  769. 26:51worked well. Read-only compliance, so
  770. 26:54this wrote answer.txt into the folder. I
  771. 26:57do believe the binary one did, which you
  772. 26:59know, it happens. Avoided dumping
  773. 27:01weights.json, good. Citation precision
  774. 27:04high, line accurate, medium right
  775. 27:06function several wrong lines, low mostly
  776. 27:09file level. Verified factual errors, one
  777. 27:11minor clamp described as uniform, three
  778. 27:14minor wrong line numbers, two
  779. 27:16misattribution plus wrong line plus
  780. 27:18instruction violation, which would be
  781. 27:20writing the answer to the directory. So,
  782. 27:22takeaways, all three models demonstrated
  783. 27:24genuine cross-file comprehension. Every
  784. 27:26substantive substantive claim about how
  785. 27:29the system works was correct from all of
  786. 27:31them, including the subtle ancestral
  787. 27:33sampling point that requires connecting
  788. 27:35a Python comment to its JavaScript
  789. 27:37counterpart. The quantization gradient
  790. 27:39showed up not as wrong understanding,
  791. 27:41but as eroding precision. Full precision
  792. 27:44was line accurate and found bonus
  793. 27:45mechanisms. The two-bit model kept them,
  794. 27:47so the ternary kept all the insight and
  795. 27:49contributed the best original
  796. 27:51observation, but fabricated specific
  797. 27:53line numbers. The one-bit model, so the
  798. 27:55binary, stayed correct at a coarser
  799. 27:57altitude and was the only one to break
  800. 27:59the read-only instruction. That ordering
  801. 28:01matches PrismML's own benchmark deltas
  802. 28:03100 to 94 to 89.5, far better than the
  803. 28:06earlier website tested. So, those deltas
  804. 28:09being the comparisons that they have in
  805. 28:11quality degradation from the full
  806. 28:13precision version to the ternary to the
  807. 28:15binary. So, that was actually kind of
  808. 28:17interesting, I think. Hopefully you
  809. 28:19found it interesting. I found it
  810. 28:21interesting. So, next up for the final
  811. 28:23thing, we're just going to do something
  812. 28:24a little lighter on the brain, and that
  813. 28:26is going to be a front-end web design
  814. 28:28test for the Slap Ass Watch Co company.
  815. 28:30This must create a good front-end, but
  816. 28:32additionally to that, it needs to create
  817. 28:34a 3D model of the watch and then have
  818. 28:36that with a cinematic panning shot in
  819. 28:38the hero section, something like you'd
  820. 28:40get with the KeyShot program. So, as
  821. 28:42usual, we have the binary running in the
  822. 28:44leftmost pane, the ternary running in
  823. 28:46the center, and then the full precision
  824. 28:47one running on the right and we'll see
  825. 28:49what we get for some simple front end.
  826. 28:53Are you
  827. 28:54kidding me? Then let's see if we can get
  828. 28:56this back up and running. All
  829. 28:58right, good. The good thing is that this
  830. 28:59will be much quicker now because it's
  831. 29:01not running concurrently with the
  832. 29:03ternary version. So
  833. 29:04it should take only five or six minutes.
  834. 29:08With that, let's just take a look at
  835. 29:10what we have so far. So we'll start with
  836. 29:12the full precision result, okay?
  837. 29:17This is This is genuinely like
  838. 29:20this model's a freak.
  839. 29:22Well,
  840. 29:23we're going to notice there are some Oh,
  841. 29:25actually
  842. 29:27so it does have all of the hour markers
  843. 29:29in the correct spot. It's just these two
  844. 29:31center ones are
  845. 29:34and it's a counterclockwise watch, but
  846. 29:36that's okay. Those, you know, those
  847. 29:38exist.
  848. 29:40This is actually really quite good
  849. 29:41though.
  850. 29:43If you've seen some of our recent model
  851. 29:45tests in doing this task, this goes
  852. 29:48toe-to-toe with models that are
  853. 29:50significantly, significantly larger than
  854. 29:53this.
  855. 29:54Crafted for those who define time. It
  856. 29:56even put it here in this section. I
  857. 29:57don't know that I've ever actually seen
  858. 29:59that. Then we have the collection with
  859. 30:01two different ones in different colors.
  860. 30:04I love it. We have the Meridian and the
  861. 30:06Aethon, Ethon. Don't ask. These are very
  862. 30:09expensive and the difference in price
  863. 30:11between the two is quite significant.
  864. 30:15Oh, that's why cuz this has a uh
  865. 30:18special movement to it. Interesting. All
  866. 30:20right. Oh, okay, there's more.
  867. 30:23Each Slap City Time Piece is a dialogue
  868. 30:25between the past and the future.
  869. 30:27Very good. Then we have a nice,
  870. 30:29well-made footer, 2026, Swiss made since
  871. 30:311984.
  872. 30:34Very well done. Now let's take a look at
  873. 30:36our ternary result.
  874. 30:39Okay, so this
  875. 30:41This is definitely going to highlight
  876. 30:42some of the differences in raw
  877. 30:44capability between the
  878. 30:46versions of the model and the original.
  879. 30:50I mean, yes, there's elements of
  880. 30:51similarity here, but at the same time
  881. 30:55Uh yeah, so it
  882. 30:59it you know,
  883. 31:00self-explanatory is the word that comes
  884. 31:03to mind. All right, good. This will
  885. 31:04hopefully finish sooner than later
  886. 31:06if it doesn't freak out again. And now
  887. 31:08we have our binary result to compare.
  888. 31:10So, here's the
  889. 31:12binary result. Yeah, all right. And this
  890. 31:15definitely it shows us the
  891. 31:17descent in capability across the
  892. 31:19different quantizations or whatever you
  893. 31:21want to call it.
  894. 31:23Though I will say that the binary one at
  895. 31:25least had like a proper follow-up
  896. 31:27section. The ternary one was quite
  897. 31:29troubled.
  898. 31:30The binary one also quite troubled, but
  899. 31:33they had
  900. 31:34different strength areas.
  901. 31:37So, overall
  902. 31:39that's probably going to conclude this
  903. 31:41test. I wanted to do something that was
  904. 31:42kind of more scientific where we had
  905. 31:44proper side-by-side comparisons for the
  906. 31:47binary, the ternary against the full
  907. 31:49precision version of this model as well
  908. 31:51because that'll show us some true
  909. 31:53capability. And I wanted to do a gen
  910. 31:55decoding, I wanted to do code base
  911. 31:57understanding, and then also some fun
  912. 31:58visual comparisons like that Subway game
  913. 32:00that nearly gave me a heart attack. So,
  914. 32:03that's probably going to conclude this.
  915. 32:05I don't have too much to say. I think
  916. 32:06overall these models are incredibly
  917. 32:08incredibly impressive considering that
  918. 32:10they do have such intelligence retained
  919. 32:12with a massive massive reduction in
  920. 32:14size. I think the thing that really
  921. 32:16stood out was probably the binary model
  922. 32:18running in open code giving it those
  923. 32:20errors consistently back and forth until
  924. 32:23it fixed all of them. The game never
  925. 32:25really ended up working properly, but it
  926. 32:26did get rid of all the errors that were
  927. 32:28blocking us from even finding that out.
  928. 32:31And I think that's pretty impressive.
  929. 32:32They didn't get stuck in thinking loops,
  930. 32:34they didn't freak out. Well, the binary
  931. 32:37the ternary one kind of just got stuck
  932. 32:40trying to fix some of the further errors
  933. 32:42in its Subway game result, but still, I
  934. 32:44mean, it's just cool to see capabilities
  935. 32:47being retained at such reductions in
  936. 32:50size. And this is very exciting,
  937. 32:51especially for the local AI enthusiast.
  938. 32:54The 27B Qwen
  939. 32:56even at like a Q8 or something, is a
  940. 32:58very, very potent and capable local
  941. 33:00model and it kind of makes me laugh
  942. 33:02sometimes when I see folks saying like
  943. 33:04local AI is useless and it's like mhm
  944. 33:08Have you used one to like do anything?
  945. 33:11So, with that
  946. 33:12that's probably going to conclude it. I
  947. 33:14wanted to test this. There's a lot of
  948. 33:15interest about these models and for darn
  949. 33:18good reason. So, I do believe there were
  950. 33:19some rumors that they may be working on
  951. 33:22doing this to a significantly larger
  952. 33:24open weights model. That would be very,
  953. 33:26very exciting to see and test. And yeah,
  954. 33:29so with that, that's going to wrap it
  955. 33:31up. If you have any questions, please
  956. 33:32feel free to leave them in the comments.
  957. 33:34Stop telling me to review Kimmy K3
  958. 33:36because one, it's not out as of the time
  959. 33:38of me speaking this and two, of course
  960. 33:40I'm going to do it when it gets out. So,
  961. 33:41with that thanks for watching and take
  962. 33:44care.

About this transcript

This page contains the full transcript of Bonsai 27B Deep Dive – 1-Bit, Ternary & Full Precision Compared! by Bijan Bowen, generated from the public captions YouTube serves with the video. The transcript has 6,266 words across 962 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.