Tales from the jar side: Kendrick vs Drake again, McCartney songs, Prompt stuffing vs RAG, Laptop setup issues, Python, and the usual toots and skeets
If Millie Bobby Brown grows to 1000 times her size, she becomes Bobby Brown (rimshot, c/o @sireviscerate.bsky.social)
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of November 24 - December 1, 2024. This week I taught my regular courses at Trinity College.
Kendrick vs Drake, the Feud Continues
Earlier this year, my son, who was living with us at the time, came downstairs all excited. He informed me that there was a massive beef going on between rappers Kendrick Lamar and Drake, and it was both highly vicious and incredibly entertaining.
Given my age group, you probably won’t be surprised to hear that I’d heard of both of them, but that’s about it. I certainly had no idea about their music or their reputations, though on my one trip to Toronto a few years ago the cab driver (this was pre-Uber) mentioned Drake more than once. I therefore listened to my son and nodded along, though I had no idea about any of it. I don’t have anything against rap, but I’m a long-term Paul McCartney fan, which means I haven’t paid much attention to lyrics in years.
A few samples from McCartney’s now 50+ year solo career:
Somebody’s knocking at the door
Somebody’s ringing the bell
Do me a favor
Open the door
And let them in.
Or
We’re so sorry, Uncle Albert,
But we haven’t done a bloody thing all day.
We’re so sorry, Uncle Albert,
But the kettle’s on the boil and we’re so easily called away
Or even
Was your father as bold as the sergeant major?
Well how come he told you that you were hardly old enough yet?
And Jet, I thought the major was a lady suffragette
Jet! Oooooooooo. Jet!
Years ago, I didn’t have the Internet to inform me that what few lyrics I thought I understood I had wrong. I’m rather embarrassed to admit how long I believed it was, “And in this ever changing world in which we live in,” when the actual words are, “And in this ever changing world in which we’re living,” part of Live and Let Die. My friend Glenn Vanderburg disabused me of that notion, but at least he was nice about it.
(Pause as I let the long instrumental part of Live and Let Die go through my head yet again.)
(Oh, good heavens. I just looked it up and discovered that the middle bridge on that song is:
What did it matter to ya?
When you got a job to do
You got to do it well
You gotta give the other fella hell!
I’ve had that last line wrong in my head forever. I always thought it was, “You gotta give the other fella a hand,” which never made any sense and didn’t even scan, but hey, it was McCartney we’re talking about. Who knew that this time the lyrics actually worked? Yikes.)
(As long as I’m on a tangent already, my wife and I had a brief discussion this week about how so many James Bond movies had better theme songs than movies. Live and Let Die is a typical example. I’d argue Goldfinger is another one, as is Moonraker. Die Another Day is a bad movie (though I still like Pierce Brosnan’s Bond) with a much loathed theme song by Madonna. The Spy Who Loved Me is the opposite — both a good movie and a great theme song, and I’d say the same about Skyfall. YMMV, of course.)
I blame Sir Paul for the fact that my ability to clearly discern lyrics atrophied over the years, so no, I’m not exactly the target audience for either Kendrick Lamar or Drake. The feud came up again this week, partly because my son came over for Thanksgiving and also because Drake, in what hopefully is a final gesture of futility, decided to sue Universal Music Group over the popularity of the song Not Like Us. Yeah, good luck with that. Or, as my son put it, he lost the battle so badly he did the equivalent of crying to his mom about how unfair it all was.
For me, the real usefulness of the beef was as a demo in my AI course for undergrads at Trinity College this semester, talking about the difference between prompt stuffing and Retrieval Augmented Generation (RAG). After all, the feud has been going on for years, but the escalation happened this year starting in April, which is after the cut-off of the training data for most commercial large language models.
I’m now working on a new video that contains several demonstrations as tests. I used LangChain4j to load up GPT-4o-mini, and gave it a list of four questions:
private final List<String> prompts = List.of(
"Who started the beef about between Drake and Kendrick Lamar?",
"How did it escalate in 2024?",
"Who won?",
"""
What are the chances Kendrick will perform
"Not Like Us" during the 2025 Super Bowl
halftime show?
"""
);
I have four related tests:
My first test doesn’t give the LLM any extra information, so it has no idea what happened this year. OpenAI models are able to search the web now, so I wondered if it would do that without me specifically asking, but apparently not, or at least not through the programmatic interface.
In the second test, I tried including the entire Wikipedia article on the feud inside the request. Of course there’s a Wikipedia article, and of course it’s huge and still growing. At the moment it has 187 references at the end, not to mention all the links and CSS styling. The article with everything is over 500K in size (!), so basic prompt stuffing didn’t work.
The third test uses the Jsoup library (an open source Java library for scraping web pages) which was able to extract just the text of the article from the web page, and that got it down to small enough to include, though just barely. That test gave decent answers, though it hedged its bets on the Super Bowl halftime question.
The final test used RAG with an in-memory embedding store, and that worked fine. The answers were pretty similar, but they at least came back pretty quickly once the initial data was split into 1200 segments (whoa).
Look for that video to come out soon.
Incidentally, my students agreed almost completely that Kendrick will definitely perform Not Like Us at the Super Bowl. This is, from what I understand, old-school hate among rappers similar to that from way, way back in the 90’s (sigh), so a public diss like that is inevitable.
If you, like me, need a bit more background on the situation, comedian Josh Johnson has a great explainer about it on his YouTube channel. My wife and I recently got to see him live, and he’s fantastic.
Setup Issues
Last month I got my first new phone in three years. I went with the Pixel 9 Pro Fold:
It took a few days to get it set up with everything I need, included my password manager and all the different apps, but it’s good now.
About a week ago I received my new laptop, also after a couple years:
If you can’t read the specs, I basically maxed it out. That meant 128GB of RAM and 4 TB on the hard drive, with a 16-core CPU / 40-core GPU / 16-core Neural Engine (whatever that is). It’s a monster, but I haven’t really put it through its paces yet. I’m still configuring it to do everything I want. I plan to keep this one for a while, so it’s taking time.
Today is the first newsletter I’ve written on the new machine, so it only makes sense it’s also on the new machine.
Python
So far I’ve taken the attitude that since I’m interested in AI integration more than AI itself, I didn’t need to really dig into the Python programming language. Next semester I’m teaching an actual AI course at Trinity College, however, and it’s finally time to admit I need to get better at Python.
That means I’ve been spending a fair amount of time digging into related YouTube videos. That’s been a little challenging. Python is often used as a beginner language, and I don’t really need to sit through the basics of variables, loops, and if-statements any more. In fact, I keep waiting for them to explain how they handle the Python equivalent of Java records, sealed interfaces, functional programming, and more.
What I’ve seen recently is information on list comprehensions and generators. That looks interesting. I see there’s related info available on lambda functions, which I assume are related.
The real time sink the last week or so has been spending hours that experienced developers know immediately, like how to set up or fix a virtual environment with the major IDEs, PyCharm and VS Code. I’m getting there, but it’s a learning curve I didn’t really expect to have to climb this late in my career. Still, it can’t hurt to understand another language, and it does make a lot of the AI material more accessible.
The joke around the AI community is:
The language of statistics is R.
The language of machine learning in Python.
The language of AI is PowerPoint. (rimshot)
That’s because so many VC funding proposals include AI, get it? Ha.
Toots and Skeets
Bluesky, the Adventure Continues
My friend Andres Almiray posted about the site Bluesky Roaster, so I tried it out.
Huh. “The Code Whisperer with a Symphony of Tweets.” Ooookay. “A maestro of Java, humor, and the occasional existential crisis.” Not so much a crisis; more of a chronic condition. “Part coding genius, part musical soul, all wrapped in a delightful package of dad jokes and tech wisdom.” Dad jokes? Who me?
Oh, who am I kidding? That’s going on my (expired) business cards from now on.
Paranoid, or realistic?
If a real librarian said this, would it be funny or mean? Probably both.
Kwisatz Haderach on line 1
Works on multiple levels.
Poor AI
Won’t somebody think of the poor AI data scraper without laughing? Probably not.
Too close to home
That hits me where I live. Here’s another one:
It can't be too late to say that this was so wrong. (rimshot again)
Thanksgiving gags
Yup, these were back-to-back-to-back-to-back in my favorites list.
Related:
I remember that game, and yeah, it was glorious.
Also related:
We had our first terducken this year. It was … different. Better than expected, but I like turkey better.
Btw, RIP Tony Todd, the best Klingon on Star Trek other than Worf. I know he was also a grown-up Jake Sisko in DS9, and he was good at it, but I loved him as Kern. My wife and I went to a comic book convention a couple years ago and actually met him, and he was charming. I’m glad we got to tell him how much we loved his performance.
And to round out the set:
Sure, but the cosine of pi is always one. See, I can play too.
Wait, the cosine of pi is always -1. Never mind.
Arts and Crafts
Have a great week, everybody!
Last week:
My regular Trinity College schedule.
This week:
Week 1 of Spring in 3 Weeks, on the O’Reilly Learning Platform
Practical AI Tools for Java Developers, as an NFJS Virtual Workshop
My regular Trinity College schedule.