
@BillBarnhill on https://xitter.gq/t.co/bCq2pElf1x @BillBarnhill on https://xitter.gq/t.co/hJufOjOdKO 25+ year sw engineer with a focus on distributed systems, messaging, blue check
42.967621,-75.440524
Joined December 2008
- Tweets8.3K
- Following4K
- Followers1.5K
- Likes3.4K
BillBarnhill retweeted
𝗥𝗔𝗚 (Retrieval Augmented Generation) vs. 𝗖𝗔𝗚 (Cache Augmented Generation).
There has been a lot of buzz surrounding CAG lately. Let’s see what the differences are betweenRAG and CAG:
𝘙𝘈𝘎
These are the steps for implementing generation for naive RAG:
𝟭. Embed a user query to be used for contextual search via vector DBs or move straight to the step 2 if no contextual search is required.
𝟮. If Contextual search is required, query the context store to retrieve relevant context. If it is not required, use other means to search for relevant data
𝟯. Combine original user query with the system prompt that instructs the final answer construction.
𝟰. Enrich the final prompt with external context retrieved in step 2.
𝟱. Return the final answer to the user.
𝘊𝘈𝘎
𝟭. Pre-compute all of the external context into a KV Cache of the LLM. Cache it in memory. This only needs to be done once, the following steps can be run multiple times without recomputing the initial cache.
𝟮. Pass the system prompt including user query and the system prompt with instructions on how cached context should be used by the LLM.
𝟯. Return the generated answer to the user. After this, clear any generations from the cache and keep only the initially cached context. This makes the LLM ready for next generations.
𝘔𝘺 𝘵𝘩𝘰𝘶𝘨𝘩𝘵𝘴:
➡️ While it has only been described in a white paper for the first time, it is not a novel concept. We have been using different variations of CAG since Anthropic and OpenAI introduced Prompt Caching.
❌ While it might sound strong on paper, LLMs continue to suffer in accuracy while working with extensively long context.
❌ In real use cases, especially enterprise, CAG would cause a lot of security issues due to inability to isolate data.
❌ CAG does not work with constantly changing data as KV Cache would need to be continuously recomputed.
✅ CAG is strong when you need to cache reasonable amount of static data that is not sensitive.
✅ Real magic happens when you combine RAG and CAG into a single system. More on it in future posts, stay tuned in!
Have you played with CAG already? Let me know in the comments 👇
#LLM #AI #MachineLearning
Want to learn how to build an Agent from scratch without using any LLM Orchestration framework? Check out my article here: newsletter.swirlai.com/p/bui…
BillBarnhill retweeted
Almost five long years of blood, sweat, and tears… and it’s finally here! 🙌 Thank you to everyone who helped and supported me—we did it! 🎉 It feels surreal to finally hold it in my hands 🤗
BillBarnhill retweeted
Update! My Elixir Stream Week talk will be on Elixir v1.18:
The next Elixir version will be a massive step up in several directions. Come listen to the progress on the on-going type system work, Language Server pubsub, built-in JSON capabilities, ExUnit features, and much more!
📢 One week left until Elixir Stream Week! Aaaand also one exiciting update to the linup 👀
Get ready for @josevalim's broadcast, where he'll talk us through all the exciting changes to @elixirlang v1.18 🔥
More about ESW: elixir-webrtc.org/esw.html
#MyElixirStatus #ElixirRadar #ElixirStreamWeek #ESW
BillBarnhill retweeted
So... my contract gigs will end in a few days.
I’m now looking for a job! 🤓
- Principal engineer, backend/systems/arch focus
- Fully remote, flexible hours (hard to find ppl in the same tz), pref async work
- @elixirlang is def my strength, but I just love doing stuff
BillBarnhill retweeted
The @ZNBLLC @Kickstarter has not reached its goal but that's not the end of these anthologies. I'll figure out a way to get them out there. Keep watch for whatever comes next. And thank you to everyone who backed this project! #kickstarter #crowdfunding #fantasy #scifi #sff
BillBarnhill retweeted
Help fund four new #sff #anthologies about #shifters, #pirates, and a #sharedworld featuring @JulietEMcKenna, @MistyMassey, & @HNTurtledove from @ZNBLLC at @Kickstarter! Become a backer at tinyurl.com/ZNBKickstarter20… #kickstarter #scifi #sciencefiction #urbanfantasy
BillBarnhill retweeted
If you are using GitHub to manage your Elixir project, you may also want to set up a CI pipeline 🏗️ I wrote an article on how to create a basic workflow using GitHub actions. It covers testing your application, publishing to hex and containerization 🐳
farens.me/blog/elixir-ci-tes…
BillBarnhill retweeted
While teaching a python class today, the student watched me do some magic with zed editor and immediately pleaded we use it instead.
Sadly they were all windows users.
BillBarnhill retweeted
Erlang/Elixir is just bananas. This is how many lines of code it takes for me to support compiling a machine learning CPU/GPU model in one node (it can be expensive, 30s+), and then send it to another node AS IS for execution: github.com/elixir-nx/nx/comm…
BillBarnhill retweeted
"Zero to Production in Rust" has been updated!
It now uses the latest Rust compiler and the latest version of all its dependencies. Many reader-reported issues have been fixed, both in the content and in the typesetting.
If you were thinking about it, go get a copy!
BillBarnhill retweeted
Back WERE-2, an #sff #anthology from @ZNBLLC on @Kickstarter at tinyurl.com/ZNBKickstarter20… NOW! Stories about #shifters other than #werewolves by @RandeeDawn, @AustonHab, @GiniKoch, and @GailZMartin! Support now! #amreading #amwriting #fantasy
BillBarnhill retweeted
Back SKULL X BONES, an #sff #anthology from @ZNBLLC on @Kickstarter at tinyurl.com/ZNBKickstarter20… NOW! Stories about #pirates by @VioletteMalan, @MistyMassey, & @AlanSmale! Support now! #amreading #amwriting #amreadingfantasy #fantasy #scifi #kickstarter #crowdfunding
BillBarnhill retweeted
We are $609 away from $10K in the latest @ZNBLLC @Kickstarter for 3 new #sff anths about #shifters, #pirates, and a #sharedworld city at the center of 8 portals! BACK NOW at tinyurl.com/ZNBKickstarter20… and help us reach $10K by the end of the day! Support #SmallPress! #fantasy #scifi
BillBarnhill retweeted
Five hours into the latest @ZNBLLC @Kickstarter as we're at $4,322! Have you pledged it yet? 3 new #sff anths featuring #shapeshifters, #pirates, and a #sharedworld! Back now at tinyurl.com/ZNBKickstarter20…! Support #SmallPress! #kickstarter #crowdfunding #fantasy #sciencefiction #sff
BillBarnhill retweeted
Announcing the official Elixir Language Server team dlvr.it/TBybm2
BillBarnhill retweeted
Please welcome Elixir's official Language Server team: @icecreamcohen (Lexical), @mitchhanberg (NextLS), and @lukaszsamson (ElixirLS) team up to provide a unified language server platform.
Read all about it here: elixir-lang.org/blog/2024/08…
BillBarnhill retweeted
This is today people! SKULL X BONES, that's me!
Coming August 15th, Noon Eastern, the latest @ZNBLLC @Kickstarter featuring SKULL X BONES about #sff pirates with @VioletteMalan, @MistyMassey, & @AlanSmale! kickstarter.com/projects/znb… #kickstarter #crowdfunding #fantasy #sciencefiction #scifi
BillBarnhill retweeted
The latest @ZNBLLC @kickstarter is LIVE!!! Back 3 new #sff themed anthologies called WERE-2, SKULL X BONES, and AMPYRIUM: MERCHANT WAR now and get up to 15 digital bonus rewards, including @bentateauthor's #epicfantasy novel CRYSTAL LATTICE! tinyurl.com/ZNBKickstarter20… #kickstarter
BillBarnhill retweeted
"100 exercises to learn Rust" is the material we use to teach Rust at @mainmatter, as a 4-day workshop.
You can access it all at rust-exercises.com
Enjoy!




















