Safety Immersion and Gamified Hazard Training for Industry 5.0 Workers
$1.5M Ohio BWC grant | Miami University | 2025–2027
AI + VR + AR safety training platform for Ohio manufacturing workers.
Two components: gamified VR hazard simulation + real-time AR coaching. How can we create AI based training to prevent workplace injuries in manufacturing?
Test out here
This workshop has three goals:
How an LLM processes text:
Text → Tokens → Token IDs → Embeddings → Transformer -> Neural Network -> Decode -> Tokens → Text
Source: Geeks for Geeks
OpenAI Tokenizer
https://platform.openai.com/tokenizer
source: CauserWriter
Semantic: relating to meaning in language or logic.
Great Video from 3blue1brown
🤔 Question
Can we use this for classification?
Example:
“I deposited money at the _ _ _ _”
“I sat on the river _ _ _ _”
Text-generative Transformer models operate on the principle of next-token prediction: given a text prompt from the user, what is the most probable next token (a word or part of a word) that will follow this input.
Transformers allow the LLM to understand things like: based on ALL the tokens I have seen, what should each token mean in this specific context.
When I predict the next token, how much attention should the model pay to all the preceding tokens?
Attention blocks in transformer models allow all tokens to talk to each other.
Within each Transformer block, the multi-head self-attention layer is what allows tokens to communicate with each other.
Without it, each token would be processed in isolation. The FFN layers that follow operate per-token, so attention is the only mechanism for inter-token information flow.
Source: Cho et al. (2024). Transformer Explainer. IEEE VIS. — Click here
Attention Is All You Need
LLMs are just recursively predicting the next token.
Preceding tokens dictate the output probability. By adding “OH,” probability increases by double.
Temp changes the probability distribution of the predicted tokens. Higher temp = more randomness.
temperature=0: most deterministic. Use for evals, grading, data extraction — anywhere reproducibility matters. In SIGHT, our LLM-as-judge uses temp=0 so the same question gets the same grade every run.temperature=0.7–1.0: more creative, varied outputs. Use for brainstorming, marketing copy, conversational agents.max_tokens: hard cap on generated output length.reasoning_effort: controls how much internal reasoning budget is used.❌ The model will confidently list modes like “Safeguard,” “Emergency,” or “Automatic” — plausible-sounding but wrong.
✅ Normal, Reduced, Recovery — grounded in the manual.
The model didn’t get smarter. We just gave it the right context. That’s RAG.
We know that base LLM knowledge — especially smaller models — can be stale or incomplete. Ask a small model “Where is Miami University?” and it may say Florida.
We also know that preceding tokens play a pivotal role. Add “Ohio” to the prompt and the answer changes entirely. Prompting and context matter.
You probably already know that giving your notes to an LLM as context and asking for a study guide is better than just asking for a study guide on a certain topic.
🤔 Question
Is there a way, every time we ask an LLM a question, it injects the right context into the prompt?
These all break when data is messy, incomplete, or described inconsistently — which is most real-world data.
🤔 Question
Say you are building a RAG system for all your emails you have received (50000+). When would you use SQL retrieval vs. vector retrieval?
Think of LangGraph like a flowchart you can run.
If LangChain is a recipe (step 1, step 2, step 3), LangGraph is a choose-your-own-adventure book.
Think of these like lego block libraries for building LLM apps. They handle the nuisance code so you can focus on the architecture and logic of your application.
This is the case we will be working with in the code-along.
builder = StateGraph(State)
# Nodes
builder.add_node("retrieve", retrieve)
builder.add_node("generate", generate)
builder.add_node("extract_keywords", extract_keywords)
# Edges
builder.add_edge(START, "extract_keywords")
builder.add_edge("extract_keywords", "retrieve")
builder.add_edge("retrieve", "generate")
builder.add_edge("generate", END)
# Compile & view
graph = builder.compile()
display(Image(graph.get_graph().draw_mermaid_png()))
TypedDict — a typed Python dict that every node in the graph can read and write to.add_messages appends instead — useful for building up a conversation history.from typing import TypedDict, Annotated, List
from langchain_core.messages import AnyMessage
from langgraph.graph.message import add_messages
class State(TypedDict):
messages: Annotated[list[AnyMessage], add_messages] # appends each turn
question: str # overwritten each call
documents: List[str]
generation: strfn(state) -> dictadd_edge(a, b) — always routes a → badd_conditional_edges(a, router_fn) — routes dynamically based on state valuesSTART and END are built-in sentinels that mark entry and exit points# MCP Server: expose a tool
@server.list_tools()
async def list_tools():
return [Tool(name="get_weather", inputSchema={...})]
@server.call_tool()
async def call_tool(name, arguments):
return get_weather(arguments["city"])
# MCP Client: discover and use it
tools = await session.list_tools() # "What can you do?"
result = await session.call_tool( # "Do this thing"
"get_weather", {"city": "Cincinnati"}
)| Type | Example | Grading |
|---|---|---|
| Deterministic | “How many paintings?” | Exact match / simple comparison |
| Non-deterministic | “Describe the African art” | LLM-as-judge or human review |
temperature=0 improves repeatability but does not guarantee identical output.The best way to learn this stuff is to build something small and iterate.
Ryan Singh · Developments in LLM/RAG