TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using the Infinite Bookspace to Reason About Language Models

1 pointsby JoelEinbinder9 months ago

1 comment

JoelEinbinder9 months ago
I think Hacker News might appreciate some of the behind the scenes of this post.<p>Getting this page to load quickly was not trivial. The initial dataset of books starting sentences was over 20 megabytes. By only sending the unique prefix of each book, I was able to get that to be much smaller. Using a custom format, sorting the prefixes, and gzipping got the size down to 114kb. About 3 bytes per book. The full first sentences are downloaded on demand as the books are filtered down.<p>Rendering the books requires 5 million triangles. I used WebGL 2&#x27;s drawArraysInstanced method. This allows me to define the book geometry only once, and each book is just defined by it&#x27;s rotation&#x2F;position&#x2F;color. Then it&#x27;s just a matter of keeping the fragment shader simple.<p>Going into this project, I wasn&#x27;t sure if it was possible. But I have left feeling really impressed with how capable the web is these days if you are willing to push a bit.