MoreRSS

site iconJeff KaufmanModify

A programmer living in the Boston area, working at the Nucleic Acid Observatory.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of Jeff Kaufman

Multispecies Metagenomic Calibration

2025-06-24 21:00:00

Cross-posted from my NAO Notebook.

This is something I wrote internally in late-2022. Sharing it now with light edits, additional context, and updated links after the idea came up at the Microbiology of the Built Environment conference I'm attending this week.

Metagenomic sequencing data is fundamentally relative: each observation is a fraction of all the observations in a sample. If you want to make quantitative observations, however, like understanding whether there's been an increase in the number of people with some infection, you need to calibrate these observations. For example, there could be variation between samples due to variation in:

  • Changes in how many humans are contributing to a sample.
  • Has it been raining? (Especially in areas with combined sewers, but also a factor with nominally separated sewers.)
  • What have people been eating lately?
  • What temperature has it been?
  • How concentrated is the sample?
  • etc

If you're trying to understand growth patterns all of this is noise; can we reverse this variation? I'm using "calibration" to refer to this process of going from raw per-sample pathogen read counts to estimates of how much of each pathogen was originally shed into sewage.

The simplest option is not to do any calibration, and just consider raw relative abundance: counts relative to the total number of reads in the sample. For example, this is what Marc Johnson and Dave O'Connor are doing.

It seems like you ought to be able to do better if you normalize by the number of reads matching some other species humans excrete. It's common to use PMMoV for this: peppers are commonly infected with PMMoV, people eat peppers, people excrete PMMoV. All else being equal, the amount of PMMoV in a sample should be proportional to the human contribution to the sample. This is especially common in PCR work, where you take a PCR measurement of your target, and then present it relative to a PCR measurement of PMMoV. For example, this is what WastewaterSCAN does.

Because the NAO is doing very deep metagenomic sequencing, around 1B read pairs (300Gbp) per sample, we ought to be able to calibrate against many species at once. PMMoV is commonly excreted, but so are other tobamoviruses, crAssphage, other human gut bacteriophages, human gut bacteria, etc. We pick up thousands of other species, and should be able to combine those measurements to get a much less noisy measurement of the human contribution to a sample.

This isn't something the NAO has been able to look into yet, but I still think it's quite promising.

Comment via: facebook, lesswrong, mastodon, bluesky, substack

Local Speech Recognition with Whisper

2025-06-23 21:00:00

I've been a heavy user of dictation, off and on, as my wrists have gotten better and worse. I've mostly used the built-in Mac and Android recognition: Mac isn't great, Android is pretty good, neither has improved much over the past ~5y despite large improvements in what should be possible. OpenAI has an open speech recognition model, whisper, and I wanted to have a go at running it on my Mac.

It looks like for good local performance the best version is whisper.cpp, which is a plain C/C++ implementation with support for Mac's ML hardware. To get this installed I needed to install XCode (not just the command line tools, since I needed coremlc) and then run:

$ sudo xcodebuild -license
$ git clone https://github.com/ggerganov/whisper.cpp
$ cd whisper.cpp

$ python3.11 -m venv whisper_v3.11
$ source whisper_v3.11/bin/activate

$ pip install "numpy<2"
$ pip install ane_transformers
$ pip install openai-whisper
$ pip install coremltools
$ brew install sdl2

$ sh ./models/download-ggml-model.sh large-v3-turbo
$ PATH="$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin" \
    ./models/generate-coreml-model.sh large-v3-turbo

$ cmake -B build -DWHISPER_COREML=1 -DWHISPER_SDL2=ON
$ cmake --build build -j --config Release

Note that both older (3.10) and newer (3.13) Python versions gave compilation errors.

While I don't know if these are the ideal arguments, I've been using:

$ ~/code/whisper.cpp/build/bin/whisper-stream \
    --capture 1 \
    --model ~/code/whisper.cpp/models/ggml-large-v3-turbo.bin \
    -t 8 --flash-attn --keep-context --keep 1000 \
    --file output.txt

By default the output is quite repetitive. For example I dictated:

It looks like for good local performance, the best version to use is whisper.cpp, which is a plain C/C++ implementation with support for Mac's machine learning hardware. To get this installed, I needed to install Xcode (not just the command line tools since I needed coremlc), and then run a whole bunch of commands.

The output was:

It looks like for good local performance the best version to use is whisper.cpp, which is a plain C++
to use is whisper.cpp which is a plain C/C++ implementation with support for maximum
machine learning hardware. To get this insight into the
machine learning hardware. To get this installed, I needed to install Xcode, not just the computer
not just the command line tools since I needed core MLC.
not just the command line tools since I needed core MLC, and then run a whole bunch of commands.

The fix for not enough LLM these days is often more LLM, so I used Claude Sonnet 4 to clean it up with the prompt "Could you clean up this Whisper transcript? The things that look like repetitions aren't, it's just that whisper does a lot of 'restating' as it updates it's view of what was said." This gave me:

It looks like for good local performance, the best version to use is whisper.cpp, which is a plain C/C++ implementation with support for maximum machine learning hardware. To get this installed, I needed to install Xcode, not just the command line tools since I needed Core ML, and then run a whole bunch of commands.

This is very good! The only two things it seems to have gotten 'wrong' are "maximum" for "Mac's" and commas where I was thinking parens. And neither of these are very wrong: "Mac's" comes out verbally as "max" and "maximum" is also plausible in context; the commas read fine, perhaps better than my parens.

I set this up a couple weeks ago, and have generally been finding this quite useful.

Comment via: facebook, lesswrong, mastodon, bluesky, substack

Grounding to Avoid Airplane Delays

2025-06-21 21:00:00

I recently flew through CLT and spent more time delayed than in the air. There were summer thunderstorms, and with the lightning it wasn't safe for workers to be out. This meant no loading, unloading, docking, refueling, anything. On the way in we sat on the tarmac for 3hr waiting for lightning to let up; on the way back we sat in the terminal (much better) while the incoming flight suffered through our prior fate.

Ground delays due to electrical storms are common, and each minute of closure is extremely expensive for the airlines in addition to being painful for the passengers. We don't stop inside work when there's lightning, why can't we get the same protection for ground workers? This is something we know how to do: give the electricity a better path to ground.

We could build grounded towers, about 100ft high, and run a grid of cables between them. Cover the area adjacent to the terminal, which is the only area you need people working outside. While this wouldn't be worth it all airports, the ROI at a high-closure airport like Orlando, Dallas, or Miami would be only 3-4 years. In 2008, Heitkemper et al. (Lightning-Warning Systems for Use by Airports) estimated that reducing ramp closure duration by 10min after an area strike would have saved $6.2M summer 2006 at ORD and $2.8M MCO. Let's try to get an annual estimate in 2025 dollars:

  • Annual savings would be moderately higher (perhaps 20%), since this number is just Jun-Aug and there's some lightning in the off season.

  • We're also talking about reducing the delay from 30min all the way down to 0min, which should give roughly 3x the savings.

  • Planes are scheduled and filled more tightly than they were in 2006, increasing the cost of cascading delays. Guessing this is an increase of 30%.

  • Traffic is up 70% at MCO between 2006 and 2024, and 25% at ORD.

  • There's been 60% inflation since 2006.

Taken together, the annual cost savings of eliminating lightning closures would be ~$36M at MCO and ~$58M at ORD.

The cost of installing a system is hard to say, but it's a matter of building grounded towers about 100ft tall (above the tails of the tallest planes) and running cables between them. Everything is much more expensive due to being at an airport, but if you're doing hundreds of gates perhaps figure $300k/gate. Then MCO with its 129 gates would be $40M and ORD with its 215 gates would be $65M.

With annual savings in the same ballpark as installation costs, this would be excellent ROI. And even if it costs five times what I'm estimating here it's still well worth it.

Am I missing something? None of this is new technology, ground delays due lighting have been an issue as long as we've had planes, this seems like the obvious solution, and it could have been done anytime in the past ~75 years. Is it more expensive than I'm guessing? Not protective enough? Hard to fit the towers in without getting in the way of moving the planes? Impractical to dissipate this much electricity into the ground without generating hazardous step potentials? Demonstrating safety to the satisfaction of OSHA and unions impractical? Airports have to pay but airlines get the benefit? Only recently became worth it as increased loading an precision has increased the cost of ground delays?

Comment via: facebook, lesswrong, mastodon, bluesky, substack

Conflicted on AI Politics

2025-06-10 21:00:00

About twice as many Americans think AI is likely to have a negative effect as a positive one. At a high level I agree: we're talking about computers that are smart in ways similar to people, and quickly getting smarter. They're also faster and cheaper than people, and again getting more so.

There are a lot of ways this could go, and many of them are seriously bad. I'm personally most worried about AI removing the technical barriers that keep regular people from creating pandemics, removing human inefficiencies and moral objections that have historically made totalitarian surveillance and control difficult to maintain, and gradually being put in control of critical systems without effective safeguards that keep them aligned with our interests. I think these are some of the most important problems in the world today, and quit my job to work on one of them.

Despite these concerns, I'm temperamentally and culturally on the side of better technology, building things, and being confident in humanity's ability to adapt and to put new capabilities to beneficial use. When I see people pushing back against rapid deployment of AI, it's often with objections I think are minor compared to the potential benefits. Common objections I find unconvincing include:

  • Energy and water: the impact is commonly massively overstated, and we can build solar and desalination.

  • Reliability: people compare typical-case AI judgement to best-case human judgement, ignoring that humans often operate well below best-case performance.

  • Art: technological progress brought us to a world with more artists than ever before, and I'd predict an increase in human-hours devoted to art as barriers continue to lower.

  • Tasks: it's overall great when we're able to automate something, freeing up humans to work elsewhere. In my own field, a large fraction of what programmers were spending their time on in 1970 has been automated. Now, at companies that draw heavily on AI it's the majority of what programmers were doing just 3-5 years ago. The role is shifting quickly to look a lot more like management.

I'm quite torn on how to respond when I see people making these objections. On one hand we agree on how we'd like to move a big "AI: faster or slower" lever, which puts us on the same side. Successful political movements generally require accepting compatriots with very different values. On the other hand, reflexively emphasizing negative aspects of changes in ways that keep people from building has been really harmful (housing, nuclear power, GMO deployment). This isn't an approach I feel good about supporting.

Other criticisms, however, are very reasonable. A few examples:

  • Employment: it's expensive to have employees, and companies are always looking to cut costs. Initially I expect AI to increase employment, the same way the development of the railroad and trucking increased demand for horses. In some areas humans (or horses) excel; in others AI (or mechanized transport) does. Over time, however, and possibly pretty quickly, just as horses became economically marginal as their competition became cheaper and more capable, I expect the same to happen to humans.

  • Scams: these have historically been limited by labor, both in terms of costs and in terms of how many people would take the job. AI loosens both of these constraints dramatically.

  • Education: cheating in school is another thing that has historically been limited by cost and ethics. But when the AI can do your homework better than you can, cheating is nearly inevitable. You'll be graded on a curve against classmates who are using the AI, your self-control is still developing, and teachers are mostly not adapting to the new reality. Learning suffers massively.

I'd love it if people thought hard about potential futures and where we should go with AI, and took both existential (pandemic generation) and everyday (unemployment) risks seriously. I'm very conflicted, though, on how much to push back on arguments where I agree with the bottom line while disagreeing with the specifics. For now I'm continuing to object when I see arguments that seem wrong, but I'm going to try to put more thought into emphasizing the ways we do agree and not being too adversarial.

Comment via: facebook, lesswrong, the EA Forum, mastodon, bluesky, substack

Ghiblification for Privacy

2025-06-09 21:00:00

I often want to include an image in my posts to give a sense of a situation. A photo communicates the most, but sometimes that's too much: some participants would rather remain anonymous. A friend suggested running pictures through an AI model to convert them into a Studio Ghibli-style cartoon, as was briefly a fad a few months ago:

House Party Dances

Letting Kids Be Outside

The model is making quite large changes, aside from just converting to a cartoon, including:

  • Moving people around
  • Changing posture
  • Substituting clothing
  • Combining multiple people into one
  • Changing races
  • Giving people extra hands

For my purposes, however, this is helpful, since I'm trying to illustrate the general feeling of the situation and an overly faithful cartoon could communicate identity too well.

I know that many of my friends are strongly opposed to AI-generated art, primarily for its effect on human artists. While I have mixed thoughts that I may try to write up at some point, I think this sort of usage isn't much of a grey area: I would previously have just left off the image. There isn't really a situation where I would have commissioned art for one of these posts.

Comment via: facebook, lesswrong, mastodon, bluesky, substack

Busking with Kids

2025-06-08 21:00:00

Our older two, ages 11 and 9, have been learning fiddle, and are getting pretty good at it. When the weather's nice we'll occasionally go play somewhere public for tips ("busking"). It's better than practicing, builds performance skills, and the money is a good motivation!

We'll usually walk over to Davis Sq, tune the fiddles, set out the case, and play. We'll do a series of fiddle tunes from Lily's list, playing for 20-30min. Today I remember playing Sandy Boys, Angeline the Baker, Marie's Wedding, Cluck Old Hen, Coleman's March, Oh Susanna, Kittycat Jig, Hundred Pipers, and Trip to Moscow.

Since this is a performance we play one tune after another, with only short breaks to decide what to do next. If one of the kids doesn't remember how it goes or gets lost in the form, it's on them to figure it out and get back on, which is a skill I'm very glad for them to be learning. I'll play fiddle with them, switching between melody and rhythm to support where it's needed while still letting them show what they can do.

People often stop and watch for a bit, sometimes dance a little. Some people put in a little money, most don't, which is all fine. Today the kids made $28 in 25min, split evenly since they both played the whole time; given the diminishing marginal utility of money and my wanting them to be incentivized to play, I don't take a share.

One thing I didn't anticipate, however, has been the effect on household economy: they have much more buying power than either of us did at their age, or than they did even a couple years ago. Sometimes this means spending their money in ways that are thoughtful and seem well worth it (when our oldest wanted to save up $80 to get her ears pierced we went out busking a lot) while other times they're more free with their money than I think is prudent (a drink from a vending machine because they didn't want to use a water fountain). It's their money, though, and I think it's good for them to get a sense of how to spend it. Still, I'm thinking some about how to build more of a sense of fiscal responsibility.

Comment via: facebook, lesswrong, mastodon, bluesky, substack