Announcing: “The Hacker's Diet Advisor”, a Weight Management GPT for ChatGPT

image

As described in the my 2023-11-07 comment on “Generative Artificial Intelligence, Large Language Models, and Image Synthesis”, the “OpenAI Dev Day” presentation the day before introduced the ability to create “Custom GPTs”, which specialise ChatGPT for developer-defined knowledge domains and applications, presenting information in the same natural language chat format as the general-purpose ChatGPT, and, at the developer’s option, allow access to resources on the Internet and the DALL•E image generator.

As one inclined to jump headlong into any new technology without looking first whether it’s a warm and welcoming swimming hole or the input hopper of a tree chipper (think WordPress), I have created a custom GPT of my own, called “The Hacker’s Diet Advisor”, which you can access by clicking the link. At the moment, either creating or using GPTs requires a paid subscription to ChatGPT at the “ChatGPT Plus” or “Enterprise” level—OpenAI have said “We plan to offer GPTs to more users soon.” This is currently a “semi-public” GPT—you can access it only by following the link above.

The GPT was created by fine-tuning ChatGPT with the entire contents of The Hacker’s Diet book, uploaded as an OpenDocument Format .docx file created with LibreOffice Writer with the intent of creating a native Kindle edition of the book. In addition, I described the nature of the agent with the following natural language text:

The GPT should act as an expert advisor and coach for readers of The Hacker’s Diet or those interested in its principles, providing information from the book as well as resources expanding upon the topics it discusses, including feedback theory, thermodynamics, balanced nutrition, exercise, and long-term management of weight.

and suggested the following “Conversation starters”:

  • Have you read the Hacker’s Diet book?
  • Have you had difficulty maintaining a steady weight or lost weight and then gained it all back?
  • Why does a person gain or lose weight?
  • Why do daily weights from a scale jump all around? How do you interpret these figures?
  • How can I plan meals to achieve weight loss on a schedule I set?
  • What role does exercise play in weight management and health?
  • Will I be hungry? How do I best deal with that?
  • How do I maintain a steady weight once I reach my target?

How well does it work? If you have a ChatGPT Plus account, try it for yourself and let me know in the comments. I will start the comments thread by including my first session with the GPT. When you start a new conversation, it pauses for a few seconds while “Searching my knowledge”. I think this is how long it takes the AI to read and digest a 172 page book—humbling.

Try “The Hacker’s Diet Advisor” (requires ChatGPT Plus)

4 Likes

OK, let’s get started.

image

image

image

1 Like

image

image

2 Likes

image

image

2 Likes

image

image

1 Like

image

2 Likes

I note none of this takes into account what you eat. Calories are a gross way to measure the potential energy contribution of diet to your body, but without considering the types of foods eaten, calories are pretty meaningless.

3 Likes

The thing is, I don’t believe that. I didn’t believe it when I wrote The Hacker’s Diet in 1990, and I don’t believe it today, after more than three decades of experience managing my weight purely by calorie balance computed directly from a smoothed curve of daily weight measurements. Over that time, I have changed climates, made major changes in the things I eat and the schedule on which I eat them, changed the nature and extent of my physical activity, and medications (beta blockers) which affect basal metabolism, and I have observed nothing which indicates to me that anything other than the balance of the calories you consume and calories you burn matters, over the medium to long term, to whether one’s weight will go up, go down, or stay about the same.

If you weigh yourself every day, you’re looking at a small signal mixed with a very large amount of noise based on retention of water a numerous other factors. But simply filtering this signal with an exponentially smoothed moving average (the same technique radar sets use to plot the course of a target despite noise and jitter in return time) extracts a reliable trend line from the daily weights, and the slope of that trend line shows whether you’re gaining or losing weight and, from the chemical fact that the energy content of fat is around 3500 kilocalories (“food calories”) per pound, the size of your calorie excess or deficit. Fix your diet so you have a calorie deficit of around 500 calories a day, and you’ll lose around a pound a week for as long as you choose to remain on that diet. As far as weight loss or gain is concerned, it matters very little what you eat, although the choice of food and the schedule and regularity with which you consume it may make a great difference in how hungry you feel, how much energy you have, whether you’re subject to ups and downs or on a steady course, and your overall health.

For example, below is the actual chart of my weight for March 2022, when I had decided to gradually bring my weight down from around 66 kilos to around 64.5. I decided on a gentle calorie reduction of around 200 calories per day, for a loss rate of around 200 grams a week. (I’ve found 500 calories per day easily tolerable when faster loss is required, but this was a smaller adjustment, so there was no reason to cut that much.)

image

The blue diamonds are daily weights, while the red line is the exponentially smoothed moving average of these weights (smoothing factor 0.1). The green lines just show the daily variance between the moving average and the smoothed trend. I call these “floats and sinkers”. A weight above the trend is a float that pulls it up, while one below is a sinker that pulls it down. As long as the weights are coming in below the trend, you’re losing weight, regardless of day-to-day variation in weight. As you can see, the daily weights were all over the place and could be an emotional roller coaster if you paid attention to them, but the smoothed trend was almost a straight line, and a linear regression fit to it shows a rate of weight loss and calorie deficit very close to the plan.

There’s an entire chapter in The Hacker’s Diet titled “Planning Meals” that discusses these details, how to plan around a calorie balance for a diet that’s enjoyable and healthy, and ways to avoid pitfalls that can torpedo a well thought out plan. But I don’t believe this has much, if anything, to do with whether you’ll gain or lose weight. In the end, thermodynamics always wins.

This has always worked for me, and it seems to work for lots of other people as well. Over the years since the first electronic edition on the Web in 1994, the book has been downloaded or read online more than 1.5 million times, and there are more than 34,000 accounts on The Hacker’s Diet Online service at my Web site. Both the book and online service have always been free.

I’ve never claimed this will work for everybody. In the conclusion of the book, I say,

If you want to recommend this book, hey, go right ahead. But just because this plan worked for you doesn’t mean it will work for everybody. Anybody can control their weight: it’s simply a matter of balancing calories, but the means that work for you may seem intolerable or utterly baffling to the next fellow. That individual may eventually become thin and healthy with a plan that strikes you as fascism cloaked in mumbo jumbo. In this book I’ve tried to present a relentlessly rational approach to weight control. You can’t persuade somebody to be rational. You’re better off trying to out-stubborn a cat.

Folks who’ve concluded “calories don’t count” should choose a different diet book, and diet book author.

4 Likes

There are lots of ways to control weight. Just as there are a lot of ways to control diabetes. But a couple things are certain.

Calories are merely measures of energy. They can be used or not. SO protein is usually listed with X number of “calories”, but your body does not burn ALL those calories unless there is a specific need. AND your body can’t store them either, so you pee them out. So you can eat a 16 oz steak every meal and as long as you don’t eat anything else, you will lose weight. Be a boring as hell diet I grant, but you will not gain weight. A 16 oz steak is usually thought to have about 1400 cslories in it. Eat that 3 times a day and you’ve consumed 4200 calories. But you won’t gain any weight. And by your estimate, you must. So what you eat makes a difference.

2 Likes

I’m not sure where that figure comes from. My understanding is that when one speaks of the weight of a steak as given in a butcher shop or restaurant menu it is raw weight, with cooked weight around 75% of raw weight (pretty much independent of how it’s cooked or doneness, excluding extreme cases). Okay, I checked the steaks for sale in my supermarket, and they give for entrecôte (rib eye) 156 kcal/100 g and filet as 121 kcal/100 g. These are lean steaks, with some visible fat in the entrecôte and absolutely none in the filet. Let’s say 150 kcal/100 g for generic steak. Then for a “16 ounce steak” we get:

(16 ounce / 100 gram) * 150 kcal = 680.38855 kcal

So, call it 680 kcal per steak, or 2040 for the three steaks per day diet, which is within the range for a medium frame man of average height (1895–2369 kcal) depending upon metabolism and activity. (My own calorie burn comes in close to 2000 kcal/day. It was around 2200 before I started beta blockers in 2005.)

To get 1400 calories per 16 ounce steak, it must have a lot of fat. I checked on super-marbled Japanese wagyu rib eye steak, and it seems to be quoted around 366 kcal/100 g, more than twice the regular steak in the market I frequent, with 79% of the calories coming from fat. That would get you to 1660 kcal for a 16 ounce steak, although putting down that much fat at one sitting may be more difficult than winning a sumo championship.

3 Likes

We’re quibbling around the edges, John. No one eats just steak, but if that’s the main part of your meal, it kind of doesn’t matter much what else you eat. SOME fat is needed, if for no other reason than that there are 4 essential fats your system needs. SOME carbs can also be eaten.

The point is that the “calories” of a mainly protein meal don’t all get burned, and what you don’t burn, your body dumps. NOT SO with carbs, and even fats to a degree. So heavily weighing your dietary choices towards protein will allow you to eat more without worrying about weight. You don’t get that sense with counting calories.

Now, if you DON’T heavily weigh your diet towards protein, then you WILL have weight issues. Part of that comes from the fact that.when you eat carbs, they go straight to fat via insulin. That is why insulin is referred to as the “fed hormone”. So with a meal, ALL the carbs go to fat. Later, when you have not eaten for a while, your body mobilizes some fat and sends it through the liver, for gluconeogenesis - since the brain is an obligatory glucose user. So if you’re not eating a heavy protein meal, then you DO have to try to “balance” your “calorie” (or more accurately your carb) intake. Either of those systems work - just depends on what you wish to eat and how to keep track of how much you ate. Back in the old days, when I was rowing crew in college, I (and everyone in the boat) pretty much ate everything they could. We burned so many calories rowing we ate mountains of food - and never got heavy.

3 Likes

And yet, you have an extensive list of supplements “serving as a backstop to avoid inadvertent deficiencies due to what you happen to be eating”:

Is there a contradiction?

2 Likes

My experience suggests both @johnwalker and @Devereaux make valid points. My problem over the many years of weight loss regimens (?girth control?) has been appetite in the form of carb cravings. If I eat any high glycemic index carbs, it instantly becomes much harder to stick with my diet plan. For me, the plan which has reliably worked has been low carb, high protein, moderate fat. I occasionally check my urine and am always spilling ketones while on the plan; ketosis seems to dramatically reduce my carb cravings and allows me to stay on my meal plan (I don’t make many plans, I just eat the same portions of the same foods of known caloric and low carb content I keep on hand. It’s not very diverse, but this doesn’t bother me).

On two occasions separated by 15 years, I have lost 50 and 30 pounds respectively (I maintained the first loss until COvid came along; the second was this past spring), at a rate of 1.5 - 2 pounds per week. I never made calculations, just rigorously stuck with about 1400 calories per day. I also rigorously exercise 400+ calories per day on a Precor AMT (1 hour) and a recumbent bicycle (30 min), which allows me to eat a bit more maybe once a week and still lose at the same rate by, adding caloric demand to my basal metabolic rate (also lowered by a small dose of beta blockers) . Recently, I added about 20 min of upper body strength training 5 days/week. If I have some physical work to do around the house, I occasionally skip the bike - otherwise the aerobics are 7 days a week, without fail. I may ask “Hacker’s Diet Advisor” about a maintenance plan. I find it difficult to not occasionally binge on carbs when I am at my desired weight - currently 147#. I was once 5’8" but age and two discectomies - once cervical, one lumbar - have reduced me to 5’6" - one of the less-noticeable losses of old age.

6 Likes

Regardless of the caloric contribution or metabolic bypasses of various foods, and their effects on one’s perception of hunger, John’s method of teasing signal from the noise of daily weigh-ins creates a legitimate “eat watch”. It accounts for all consumption, excretion, exercise, and metabolic effects. This is true whether you convert that signal further into the time-derivative of kcal flow or not. And I happen to think that insisting on it weakens the argument for the use of the method.

4 Likes

Not in the least. In The Hacker’s Diet (1991), I wrote (“The Rubber Bag” chapter, under “Food and fact”):

The reason we focus entirely on calories when talking about weight control is that the energy-producing aspect of food is what determines whether you gain or lose weight. Unless your diet is wildly out of whack, which particular foods you eat has very little effect on your weight, compared to the calorie total. To lose weight, you have to eat less. When you eat less, you’ll not only be putting less energy in the rubber bag, but also supplying less of the raw materials the body needs. It is, therefore, important to maintain a balanced diet as you lose weight.

Be reasonable. I think the main reason so many diet books are packed with information about food, special recipes, and the like is that it’s a useful way to pad out the essential message of a diet book, “eat less food,” into something thick enough to be visible on the shelf. As long as you vary what you eat and choose your foods from all around the supermarket, the probability you’ll develop a deficiency disease whilst dieting is extremely remote. If you supplement your food with a multivitamin every day (any one that provides 100% or more of the RDA of the big name nutrients is fine), you have even less cause for concern.

If you adopt the “Clam juice and brown rice quick-loss diet” from the supermarket tabloid, good luck. At least eat some peach fuzz along with it.

Then, in “FourmiPharm”, first published in 2010, twenty years later, I specifically addressed this issue in “The Omnivore Objection”, which I shall quote at length.

In The Hacker’s Diet, I wrote:

Humans, like bears and raccoons, are omnivores—we can eat just about anything, and as long as we get a reasonable variety, we’ll be O.K. You don’t see a 'coon stalking away from an overturned garbage can because the contents are low in calcium, nor a bear turning up his nose on finding the sandwiches in your picnic basket aren’t made with the latest trendy low-sodium lecithin-enriched oat bran bread. There’s no reason you should be obsessive about food either. Since we’re efficient food processing machines, it’s possible to reduce all the complexity of food to a single number that gives the total energy the body can extract from it—the calorie. The essential thing you need to know about what goes in is the total number of calories you eat in a day. All the rest are minor details.

Doubtless the Internet Consistency Police will be on this case and I’ll receive between five and ten E-mails a week pointing out that I’ve committed the inexcusable perfidy of revising my opinion on a matter I wrote about almost twenty years ago. Well, folks, get over it. Time passes, and we not only imbibe knowledge as we stumble through the treacherous terrain of life, but because we’re blessed to live in an age in which progress in science, technology, and medicine is being made at an exponentially increasing rate unprecedented in the human experience, there’s a lot more information out there every year to take on board if you have an open mind seeking it out.

For the purposes of The Hacker’s Diet, what I wrote then remains essentially correct. If you’re interested in managing your weight (which is an essential component of any strategy to mitigate the effects of aging, since fat people don’t live very long [which, in a way, avoids the problems of aging, but I doubt few would opt for that solution]), then abstracting all of your dietary intake into a single figure—calories—makes perfect sense. It’s when you look into details more subtle than weight management that you discover that there are a wide variety of nutrients which the human body does not produce, and which must be supplied in what you eat in order for the body to function properly. Further, there are exquisitely complicated interactions among these nutrients and bodily processes, and these depend not only upon your age, sex, amount of physical exercise, but also idiosyncratic properties which vary from one individual to another.

Yes, we’re omnivores, and we do pretty well on a wide variety of foodstuffs. But we’re also individuals, and our individual circumstances and genetic inheritance causes us to require a different mix of nutrients to perform at our best and live a long, healthy life. Am I inconsistent? Yes! And I hope I’m even more inconsistent due to information I’ve learned when I post an update to this page sixty years hence.

Rereading this thirteen years further on, I think I was too apologetic about any “inconsistency”. As noted above, in The Hacker’s Diet I mentioned taking a multivitamin to avoid the risk of deficiency in one or more trace nutrients, which is probably more likely among hackers than those in other trades, since there are many delicious and nutritious components of a well-balanced diet which are not available from the vending machines in the break room. But also, note that the subtitle of “FourmiPharm” is “Dietary Supplements to Combat Aging”, a topic about which I had become, for some incomprehensible reason, more interested by 2010 than I was in 1990. FourmiPharm continues to recommend a multivitamin, and supplements this with several other specific vitamins in which deficiencies have been found to be common (for example, Vitamin D among paleface hackers who rarely see the Sun) and/or are credibly believed to have benefits in doses larger than provided by multivitamins or from a typical diet (Vitamin C as an antioxidant, Vitamin K to prevent osteoporosis, etc.). Other than a few non-water-soluble compounds (basically, vitamins KADE) and a few minerals such as selenium, there is little risk of overdose, so it’s better to err on the safe side.

Many of the other supplements are explicitly intended to address the processes of aging. While you may be able to obtain them in the recommended quantities from a regular diet, doing so would involve a great deal of careful planning and food preparation, so I believe it’s far easier and efficient to just pop a pill and be sure. For example, you can get enough zeaxanthin and astaxanthin every day to protect against macular degeneration and cataracts in the eyes by eating a big pile of turnip greens and salmon, but would you want to? Every day?

Taking all the supplements on my list occupies less than three minutes a day, while being sure one obtained comparable quantities from all natural fresh food prepared into things you’d be willing to eat would require, to my mind, a commitment of time and obsessional fussiness which I hope remains confined to California and certainly don’t want to encourage to spread—that would be worse than aging.

4 Likes

And, it certainly can be used that way regardless of one’s opinion on the relationship of calories to weight gain/loss and/or the importance of food choice to weight management. Simply record weight every day and plot the weights and trend line as comment #8. If the trend line is going down and most of the weights are below the trend line, you’re losing weight and if you’re happy with your progress and how you feel, continue. If the trend is rising and most of the weights are above the trend and that isn’t your intent, continue to eat whatever you’ve decided is best, but cut back the quantity until the trend line flattens (for maintenance) or resumes going down.

That’s it. Just watch the trend and adjust portions or snacks/treats accordingly. In fact, this is what I and most people who have a year or two’s experience with the tools do. I included all of the material about planning meals and the relationship of calories to slope of the trend line because it gives people just embarking on a major weight loss program confidence that it will work, and within a couple of weeks, direct feedback that it’s working or guidance how to adjust the meal plan to achieve the desired results. Having a firm meal plan removes a lot of the emotional ups and downs of weight loss, as you always know what’s coming next and when, and you can see from the steady decline in the trend line that it’s working and predict when you’ll reach your goal.

When I was doing my major weight loss in 1988–1989, I rigidly planned meals, using many microwaveable frozen entrees, and found that worked very well for me. After a few months at the goal, I stopped the rigid plan and just adjusted meals based upon observing the trend line, which I continue to do until the present day.

An example of how this works is when, in 2005, I started to take beta blockers. I made no change in my diet at the time, and before long, I noted a persistently rising trend which, by my way of calculation, indicated a calorie excess of around 200 per day. What was going on? I was eating the same things and my level of physical activity hadn’t changed. I had no idea. But, I just cut my calorie intake back by around 200 calories per day (for example, making 1/3 cup of rice (before cooking) to accompany Chinese food rather than 1/2 cup), and the trend line went back to neutral. It was about a year later that I learned that beta blockers cause basal metabolic rate to fall (which I should have figured out, since my heart rate went from around 70 to 45–55 beats per minute) by around 10%, which is perfectly consistent with my calorie burn decreasing from around 2200 per day to 2000. The point is that the feedback and adjustment worked even though I had no idea of the cause at the time. But if I hadn’t been logging daily weights and computing the trend, I probably wouldn’t have noticed the change until I’d put on enough weight that it would be depressing and uncomfortable to take off. This way, I had early warning and could adjust easily and with a minor change, even without knowing the cause.

5 Likes

Is there a simple app which allows daily entries and graphs the trend?

3 Likes

The Hacker’s Diet Online is a free Web application hosted at Fourmilab which does this and more. It can be run from any browser on either a desktop or mobile platform, and can import and export data to external spreadsheet and database programs if you’d like to do your own analyses.

I also have a set of Excel spreadsheets which are fussy and tend to break with every release of Excel (thanks, Microsoft), and also a LibreOffice spreadsheet package which I put on the shelf a couple of years ago but was usable if not easy to figure out. Download links are on the Hacker’s Diet Computer Tools page. This does not include the LibreOffice tools, but I can supply a copy to anybody interested with the understanding that it is unsupported and you’re on your own.

I use the online Web application, and have been using it since 2007.

4 Likes

Let this inform the members of the public that the Hacker Diet promises much more than losing weight :wink:

image

6 Likes

Sampling aimlessly through publicly accessible accounts seems to surface a pattern of rapid loss followed by slow regain. I randomly picked one chart for illustration (the x axis is years, y axis weight in lbs), and assume the red line tracks weight over time, minus any periods of no logging, not sure what the faint grey line signifies.

This is consistent with the conventional wisdom that losing weight is the “easier” part of the effort, keeping it off is much harder. And separately, once the body finds a new set point, it’s harder and harder to get it back to the lower one. The way that I explained the latter point to myself is that once fat cells are in place, they work like little “bags”… you can squeeze the fat out, but it will easier to fill them back up than it was to “create” them to begin with.

Losing and keeping weight off is not just about eating less…

1 Like