Interactive AI-Assisted Personal Trainer Simulator (Week 2)

6-October-2024 By Jeffrey Cooper

Interactive AI-Assisted Personal Trainer Simulator (Week 2)

I’ve been eager to try this for a while, to explore how an LLM, such as ChatGPT, could enhance the gym experience. In particular, I’m keen to explore the potentially useful capabilities of LLMs.  This is Week 2 in Project52.

To try to pop the hype bubble a bit- this is not intended to show a quick and dirty “let’s add ChatGPT” gimmick. More I am looking at the viability of a human language, virtual capability that would sit as a standalone offering for someone looking for realistic, guided workouts and have a goal to get more fit.

I see the uses in different ways. The most straightforward are as an adjunct, free or paid, service that a gym could offer at a tier below Personal Trainers, which is generally expensive and limited to wealthier clients.

It can also be offered as a standalone app, for solo users at home, or to use in their club of choice on their own.  It needn’t be limited to strength training workouts- it could apply to running and cycling.

Nota para los lectores españoles: Estoy escribiendo mis articulos en dos idiomas mientras lo aprendo. Para mas información, lea este artículo.

Llevo mucho tiempo queriendo probar esto, para explorar como un LLM, como ChatGPT, podría mejorar la experiencia del gimnasio.  En particular, estoy deseando explorar las capacidades potencialmente útiles de LLMs. Esta es Semana 2 en Project52.

Para tratar reventar la burbuja de hype un poco, esto no es intentado mostrar un truco sencillo de “sólo añadir ChatGPT.”  Más, estoy mirando a la viabilidad de un capacidad virtual de lenguaje humano, que podría ser una oferta independiente para alguien buscando por entrenamientos guiados realistas y tiene una meta para mejorar su fitness.

Veo los usos de diferentes maneras. El mas obvio usos son al lado un servicio, pagado o gratis, que un gimnasio ofrecerá a un nivel por debajo de Entrenadores Personales, que son caros y típicamente limitado a sus clientes más ricos.

Podría ofrecerse también como un aplicación independiente, para usuarios en casa, o para usar en sus gimnasios. No necesita limitarse el entrenamiento de fuerza- podría utilizarse para ejercicios como correr o montar en bicicleta.

The Premise

La Premisa

The premise starts with the fact that LLMs are very good at generating very readable text. They are also, to a degree, able to “compute” various outcomes based on inputs, due to the large volume of material they were trained on.

The interesting concept is that they compute at the text level. LLMs, by training on nearly the whole of humanity’s writings, have figured out language at a deep, if black-box level.  Deep inside, it has stored all the facts- actual or otherwise, as well.  It acts like a massive brain, an expert on everything, but not able to “think” too deeply on any one, with certainty.  It gives the illusion of thinking and can map your input to templates of patterns it has seen. With some additional degree of randomness thrown in (called temperature), it can expand on that and appear creative. It does a really good job at this.

What I want to achieve here is to tap into LLM capabilities to serve as a Virtual Personal Trainer.  And it will deliver a workout, which you perform in the simulated gym, and when you check out, gives you the next workout, which is based on how the last workout went- progressively increasing the workout if you are following instructions.

La premisa empieza con el hecho que LLMs son muy bueno generando textos muy legibles.  También, hasta cierto punto, son para poder “calcular” varios resultados basados en entradas, porque de el gran volumen de material en cuál se entrenó.

El concepto interesante es que calculan en un nivel de texto. LLMs, por entrenar en casi todo de los escritos de la humanidad, lo han resuelto lenguajes a un profundo, si nivel de caja negra. En lo más profundo, ha almacenado todos, hechos o no, también. Funciona como un cerebro masivo, un experto de todos, pero no puede “pensar” demasiado profundo en un solo, con certeza. Da la ilusión de pensa y puede mapear su entrada a plantillas que ha visto. Con un grado adicional de aleatoriedad incluido (llamada temperatura), puede ampliarlo y parece creativo. Lo hace un bueno trabajo con esto.

Lo que quiero alcanzar aquí es utilizar las capacidades de LLMs para servir como un Entrenador Personal Virtual. Y entregará un entrenamiento, que usted hace en el simulador de gimnasio. Cuando se vaya, se da el entrenamiento siguiente, cuál es basado en cómo fue el último entrenamiento, aumentado progresivamente el entrenamiento si está siguiendo las instrucciones.

What this Simulator is not

Lo que no es este Simulador

This simulator uses basic ChatGPT from OpenAI, specifically the gpt-40-mini model.  It is not specialized, and uses what I call “the general wisdom of the internet,” which contains all the good advice as well as all the bad advice out there.  As such, a generalized LLM should never be used as a serious personal trainer.  It would be fine as a regular user to consult with it and ask general advice, but as a programmatic coach, I would not recommend doing that.

A serious app will have more elements to it, which I discuss below.  This demo is intended to be a Proof of Concept.

El simulador utiliza ChatGPT básico de OpenAI, específicamente el modelo de gpt-40-mini. No es especializado, y utiliza lo que llamo “la sabiduría general del internet,” la cual contiene todo buen consejo y tal como mal consejo que hay ahi fuera. Como tal, un LLM general no debería utilizar como un entrenador personal serio. Sería OK como usuario habitual para consultarlo y preguntarlo consejo general, pero como un entrenador programático, no recomendaré hacerlo.

Una aplicación seria contendría más elementos, los cuáles discuto a continuación. Este demo pretende ser una prueba de concepto.

Instructions

Instrucciones

This simulation is built on top of my Connected Gym Simulator, which I wrote in 2020.  That was a full club simulation including the Front Desk.

I’ve removed parts of that sim for this purpose. I have removed the Front Desk to make room for the AI-generated workout instructions.  I also removed the scales and Physmodo measurement station, and removed the Personal Trainer feature.  All other features work as before. One other change is that the randomly selected persona of the person working out in the gym is the same until you reset the simulator. This change was necessary for the workouts to be progressive.

La simulación está construido en mi Simulador de Gimnasio Conectado, que escribí en 2020. Este fue un simulador de club completo, incluyendo la recepción.

Eliminé partes del simulador para hacer sitio a los instrucciones entrenamientos generados de IA. También, eliminé las escalas y la estación de medida Physmodo. Y también eliminé la función de entrenadores personales. Todas otras funciones se queda como antes.  Un otro cambio es que el personaje seleccionado aleatoriamente para la sesión se queda hasta reinicia el simulador. Este cambio fue necesario para que los entrenamientos sean progresivos.

For a complete explanation of how the original Connected Gym Simulator works, read
Interactive Connected Gym Simulator Launch

AI Gym Simulator Overview

If you want to jump right to the simulation, click on the link to the left. I recommend you read the rest of this article, though for a better understanding of how it works.

The workouts will always be in the lower right corner. These workouts come from ChatGPT.

Los entrenamientos están siempre en la esquina inferior derecha. Estos entrenamientos viene de ChatGPT.

All Personas Available
Persona

When you launch the simulator, you will see the selected persona, from one of the 8 in the image above.  Also, you will see a basic bio plus some fitness goals.

Cuando lanzar el simulador, va a ver el personaje seleccionada, uno de 8 en la imagen anterior. También, va a ver un biobrafía basica y algunas metas de fitness.

Check In Beacons

Make sure to read the instructions, available in the Simulator.  To emphasize here- you must go through the front door of the gym in order to activate it.  Once you “walk” through the doors, you will see the first suggested workout appear in place of the personal bio information.  Typically this takes 5-10s to generate.

Asegúrse de leer las instrucciones, disponible en el Simlulador.  Para destacar aquí, debe pasar por la puerta principal para activarlo. Una vez que cruza por las puertas, va a ver el primer entrenamiento sugerido aparece en lugar de la biografía personal. Tipicamente, tarda 5-10s para generar.

Initial Workout

Move the cursor into the gym and perform this workout.  There are a few things to be aware of, as this is not a perfect system.  ChatGPT is asked to provide estimated calories and time for the workout.  It is not necessarily accurate.  To get the most from this proof of concept, focus on the calories you are burning in the workout, rather than the time.

None of the areas of the gym are granular for specific exercises.  For weight-related exercises, use the Weightroom, for anything running or riding, use Cardio, and for other cross-functional activities, use the Cross Training area.  1 second in the simulator = 1 minute in real life, so it won’t take long to “do” these workouts.

You are free to do the workout as is, undershoot it by varying degrees, and overshoot it by varying degrees, including large overshoots.  You can also take classes- each group fitness room has a tablet outside with class schedules.  These actually change during the day and are tied to your time zone.

Entre en el gimnasio con el cursor y haga el entrenamiento. Hay unas cosas a tener en cuenta, como esta no es una sistema perfecta. Pido a ChatGPT que proporcione calorías estimadas, y un tiempo estimado para realizar el entrenamiento. No es preciso necesariamente. Para obtener el mejor de esta prueba de concepto, centrase en las calorías que quema durante el entrenamiento, en lugar del tiempo.

Ningunas de las areas en el gimnasio no es lo suficientemente granular para ejercicios específicos. Para ejercicios de halterofilia, utilice la sala de pesas, para todo lo que sea correr o montar, utilice la sala de Cardio, y para todo las actividades interfuncional, utilice la area de Cross Training. 1 segunda en el simulador = 1 minuto en la vida real, así no tarda mucha para hacer estos entrenamientos.

Es libre de hacer el entrenamiento tal cual, puede corto en varios grados, y puede pasarte en varios grados, incluso pasarte en muy exceso. También, puede hacer clases de fitness en grupo- cada sala tiene un tablet afuera con los horarios de las clases. Estas cambian realmente durante el día y está conectado a su zona horaria. 

Workout Complete Screen
Workout Summary

To end your workout, simply leave the club though the front door.  The automated system (that a club could implement) checks you out, and the workout tracking ends.

In order to continue, you need to View Summary to read the summary of your workout. From there, you close the summary, which will generate the next suggested workout.

Para terminar su entrenamiento, simplemente puede salir del gimnasio atravez la puerta principal. La sistema automática (que un club podría implementar) hacer el check out y finaliza el seguimiento del entrenamiento.

Para continuar, pulse el botón “View Summary” para leer el sumario de su entrenamiento y generar el siguiente entrenamiento sugerido.

Workout #2

This is where it gets interesting.  Your completed workout is submitted to ChatGPT, which uses that, compares it to the prescribed workout, and recommends a new workout.  This will change depending on how “hard” (or not) you worked out. If you overdo it, it will recommend a recovery workout and caution you to be careful.

From here, simply check back into the gym and do the next workout.

You can repeat this as many times as you like.  This is a pretty basic proof of concept, so at some point, it may end up suggesting some pretty crazy workouts if you repeat this 20 or 30 times.  In a real-life implementation, this would not happen.

Esto es cuando se pone interesante. Su entrenamiento completo se envíe a ChatGPT, que lo utiliza, lo compara con el entrenamiento prescrito, y recomienda un nuevo entrenamiento. Este cambiará dependiendo de lo “duro” (o no) que te ejercites. Si se excede demasiado, recomendará un entrenamiento de recuperación y se aconseja que tenga cuidado.

De aquí, simplemente reentra el gimnasio y hace el entrenamiento siguiente.

Puede repetirlo tanto como quiere. Esta es una prueba de concepto básico, así en alguno punto, es posible que se recomiende algunos entrenamientos locos si repetirlos 20 o 30 veces. En una implementación real, esto no pasaría.

Practical Application

Aplicación Práctica

To make this practical and robust, you will need to augment an LLM with a specialized knowledge base. You can do this via Retrieval-Augmented Generation, or RAG, model.

Your team of expert personal trainers will develop a knowledge base that covers a wide range of Personal Training areas, which will become a sizable set of documents.

In a RAG system, these specialized areas of knowledge are used to augment the LLM.  The documents are broken into chunks, and a vector database is created to index the contents.  There is a bit of an art to this as chunks should overlap each other some to allow for better continuity (this is not unlike 🔗Genomic Shotgun Sequencing, in some ways).

Para hacer esto práctico y robusto, necesita aumentar un LLM con una base de conocimientos especializados. Puede hacer esto con una sistema de generación por recuperación aumentada, o RAG.

Sus equipo de entrenadores personales desarrollarán un base de conocimientos que abarcar una amplia gama de areas relacionados con el entrenamiento personal, que convertirán en un conjunto considerable de documentos.

In una sistema de RAG, estas areas especializadas están utilizado para aumentar el LLM. Estos documents están dividido en trozos, y se crea una base de datos vectorial para indexar el contenido. Hay un poco de arte en esto como trozos deben solaparse  entre sí cierta medida para permitir una mejor continuidad (esto es similar de la 🔗Secuenciación Genómica Escopeta, en algunos aspectos).

RAG + Agent Model

The RAG creation process is generally only done once, for something like this, unless you update your documentation.  It is possible to also add in real time data indexing, if you needed it- that is not shown here.  An example of that might be to incorporate weather forecasts if you are building a running or cycling coach.

The diagram above is a rough architecture of how such a system might look.  Details about the User are submitted to an Agent, which consults the RAG model (for professional advice), and then uses a series of tools to do a deeper analysis on how the user is performing.

El proceso de creación del RAG se realiza una vez, a menos que actualice su documentación. También es posible que añadir indexación de dataos en tiempo real, si es necesario, pero no esta demostrado aquí. Un ejemplo de eso debe para incorporar previsiones meteorológicas si está construyendo un aplicación de entrenador de correr o montar en bicicleta.

El diagrama anterior es una arquitectura aproximada de sistema como podría quedar. Los detalles del usuario se envían a un agente, quién consulta el modelo de RAG (para consejo profesional), y que utilice una serie de herramientas para hacer un análisis más profundo en como el usuario está realizando.

RAG + Agent Message Sequence Diagram

The Message Sequence Diagram above gives a clearer view of what is actually going on.  With an Agent, you can use a number of toolsets.  For examples, I included a Human Physiology Model, which helps evaluate how you are doing in the context of your biology and workout history.  You could offer nutritional analysis and other possible tools, which could even be separately monetized.

And finally, since we are talking about automating a person’s fitness journey, there should be some checks and balances, called Safety Check here, to ensure the advice isn’t dangerous or it is showing results that might indicate they consult with a doctor.

El diagrama de secuencia del mensaje anterior le ofrece un visto más claro de lo que realmente esta ocurriendo. Con un Agente, puede utilizar varios herramientas. Por ejemplos, incluye un modelo de fisiología humana, que ayuda evaluar cómo se va en el contexto de su biología y su historia de entrenamientos. Podría ofrecerse otras herramientas posibles, que podría monetizarse por separado.

Y finalmente, desde estamos hablando sobre la automatización del viaje de fitness personal, debería haber controles y equilibrios, llamada Safety Check aquí, para garantizar el consejo no es peligroso o muestra resultados que indicaría consultar con un doctor.

Conclusion

Conclusión

While this demo is relatively light weight, I hope it gives a sense of what is possible. By taking a deep knowledge base of expertise, adding in some analysis tools, and using an LLM to wrap it all into a meaningful, very readable analysis, you can create a Virtualized Personal Trainer that gives you a new product offering at a lower price than Personal Trainers, to improve incremental revenue by appealing to a larger subset of gym members.

Or, you can create a standalone app for anyone to use in or out of the gym. And with a bit more work, you could include live coaching during the workout by feeding real-time status into the system to offer nudges to the user to make the most out of their workouts.

Mientras esta demo es peso ligero, relativamente, espero que dé una idea de lo que es posible. Empezando con una base de conocimientos de la experiencia, y añadiendo herramientas de análisis, y utilizando un LLM para envolverlo todo en un significativo, legible análisis, puede crea un Entrenador Personal Virtualizado que le ofrece un producto nuevo en un precio bajo que Entrenadores Personales, para mejorar ingresos incrementales para apelando a un subconjunto más amplio de miembros gimnasios.

O, puedes crea una aplicación independiente para cualquiera utiliza en o afuera un gimnasio.  Y con un poco más trabajo, puede incluir coaching durante el entrenamiento para alimentando el estado en tiempo real en la sistema para ofrecer empujoncitos al usuario para aprovechar el máximo de sus entrenamientos.

El contenido de estos artículos son un poco avanzado. Necesito utilizar ayuda de DeepL, particularmente en algunas porciones ultra-técnicas, per trato utilizar lo menos posible. Otras porciones fue un poco más fácil esta semana. Todavía lo estoy utilizando alrededor 25%. Poco a poco mejoro.

COMMENTS

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe

Subscribe and get a notice when the next article is published.

Thank you for subscribing.

Something went wrong.

Subscribe

Subscribe and get a notice when the next article is published.

Thank you for subscribing.

Something went wrong.