From Words to Waypoints: Teaching a Small LLM to Plan for Robots A technical post documents training Qwen3.5-9B with reinforcement learning to act as a high-level robot planner for tasks written in Signal Temporal Logic (STL), aiming to match the reliability of the much larger DeepSeek-V4.1-Flash-1017 model used as the reference teacher. The model reads a 2D workspace with rectangular obstacles and named regions plus STL clauses such as "out(D) U [0,136] in(K)" and outputs a timed path of waypoints [[t, x, y], ...] that must avoid obstacles and respect the robot's speed limit. The author states the post does not rigorously compare the LLM approach to the classical mixed-integer linear program (MILP) solver and offers no evidence an LLM planner is better, only that the LLM route is possible. From Words to Waypoints: Teaching a Small LLM to Plan for Robots Large language models are increasingly asked to act as the high-level planner of a robot: given a task in words or in a formal language, decide where to go, in which order, and when. For tasks written in temporal logic, the classical approach is to encode the whole problem as a mixed-integer linear program MILP and hand it to a solver. That works, but it can take a very long time, and the cost grows quickly with the length of the task and the number of conditions. A MILP solver is a powerful but blind search: every operator, at every time step, becomes a set of binary variables and constraints, and the solver has no notion of what they mean. A language model can understand the semantics of the temporal operators, for instance that “stay out of D until K is reached” means visiting K before entering D, and use common sense to come up with a plan directly. This post does not compare the two approaches rigorously, and we have no evidence that an LLM planner is better than a MILP solver; we are showing that the LLM route is possible. We wanted to know whether a small open model can learn to do this well. Concretely, the goal was to take Qwen3.5-9B and train it with reinforcement learning until it solves robot planning tasks written in temporal logic about as reliably as a much larger model, DeepSeek-V4.1-Flash-1017, which we use as the reference “the teacher” . This post tells the story of how we got there, in the order it happened: a first attempt that learned nothing, the fix that made learning possible, and the step that made it fast. The problem A robot moves in a 2D workspace with rectangular obstacles and named regions. Its task is a specification in Signal Temporal Logic STL , a language for properties of trajectories over time.The setting follows Multi-agent Motion Planning from Signal Temporal Logic Specifications https://arxiv.org/abs/2201.05247 , restricted to one robot with a speed limit. Any feasible path is accepted; we do not ask for the optimal one. A specification combines two kinds of pieces. Atoms say where the robot is: in B holds when the robot is inside region B, and out A when it is outside region A, where A, B, K, D and Goal are names of regions on the map. Temporal operators say when an atom has to hold. They are written as single capital letters followed by a time window in seconds: F G p means “p holds until q does”. Operators can be nested, as in the last example. Below are some examples of STL specifications: U q F 7,21 in B G 0,30 out A - out D U 0,136 in K : stay out of D until K is reached, within 136 seconds; F 153,169 G 0,5 in Goal The model reads the map and a list of such clauses and must answer with a timed path, a list of waypoints t, x, y , ... . The robot is a small square that must never touch an obstacle and cannot move faster than its speed limit. Everything the model knows about the task comes from its prompt. The system prompt explains the robot and path model, defines the STL atoms and operators with a couple of examples, and fixes the answer format; the user message lists the workspace, every obstacle and region as coordinates, the robot’s size, speed limit and start, and the specification clauses. There are no solved examples in the prompt, and every model in this post, the teacher included, gets the same prompt. The full system prompt You are a high-level motion planner for a single mobile robot in a 2D workspace. Your job is to produce a timed path for the robot that satisfies a Signal Temporal Logic STL specification. Any feasible path is accepted; it does not need to be optimal. Robot and path model - The robot is an axis-aligned square with half-width r: at position x, y its body occupies x-r, x+r x y-r, y+r . It translates only no rotation . - A path is a list of waypoints t0, x0, y0 , t1, x1, y1 , ... with t0 = 0 and x0, y0 = the start position. Times must be non-decreasing. - Between consecutive waypoints the robot moves in a straight line at constant speed. The speed on each segment, distance / t {k+1} - t k , must not exceed v max. To wait, repeat the same position at a later time. - After the last waypoint the robot stays there forever. - The robot body must always stay inside the workspace and must never overlap any obstacle touching the boundary is fine . STL specification All regions are axis-aligned rectangles. Atomic propositions: - in R : the robot body is fully inside region R equivalently, x in xmin+r, xmax-r and y in ymin+r, ymax-r . - out R : the robot body is fully outside region R it does not overlap R . Operators a, b are absolute durations in seconds, measured from the time the formula is evaluated : - p & q: both hold. p | q: at least one holds. - F a,b p "eventually" : p holds at some time in t+a, t+b . - G a,b p "always" : p holds at every time in t+a, t+b . - p U a,b q "until" : q holds at some time t' in t+a, t+b , and p holds at every time in t, t' . Formulas can be nested, e.g. F 0,30 G 0,5 in A means "at some time t in 0,30 , enter A and stay in A for 5 seconds during t, t+5 "; G 0,50 F 0,20 in B means "during 0,50 , B is always visited again within 20 seconds". The whole specification is evaluated at time t = 0, and every listed item phi1, phi2, ... must hold. Planning You have no tools. Reason carefully about geometry stay clear of obstacles, using corner points at least r away from them and timing respect v max , then give the final answer. Final answer When you are done, write the final path inside