Interpret the results
The final step of performance analysis is to interpret the results of your benchmark.
The following plots are illustrative results from a five-minute PhotoTalk run with five separate conversations and varied question lengths. Use the following data as an example when reviewing your own results.
- The illustrative capture doesn’t include the device model, LiteRT-LM version, backend, CPU thread count, or thermal starting state. Don’t use these figures as a performance baseline.
- Your
summary.txtrecords the device model. Record the active backend, screen brightness, ambient conditions, and starting device temperature separately when comparing runs.
Interpret LLM performance
LLM performance plots
The figure shows three different plots relating to time to first token (TTFT), prefill speed, and decode speed respectively. The line of best fit gives a rough estimate of the trend of each measure in relation to prompt length.
In this reference run, most TTFT measurements are around 0.25 seconds, with a slight upward trend as prompt length increases.
When you create a new conversation by uploading another image, the first inference needs to prefill the system instruction plus initial prompt. As a result, there’s a vertical cluster of five points that are ~95 tokens in length. This corresponds to the five images that are used during the benchmark.
Subsequent chat messages reuse the key-value (KV) cache of the conversation. Only the new user message — roughly 11–15 tokens in this run — is prefilled. You can see this clustering across all three graphs in the figure.
Prefill speed increases with prompt length in this run. Determine whether the same trend appears across repeated runs with similar prompts.
Prefill can be compute-intensive because it uses parallel matrix multiplications, while memory bandwidth can also affect performance. For deeper analysis, consider also measuring CPU core scheduling and memory bandwidth utilization.
Decode speed varies across the measurements. This variation can reflect changes in workload or device conditions, including thermal throttling. To further investigate, compare the timing of the measurements with temperature and power data.
Compare temperature and power
Use temperature and power plots to investigate whether device conditions coincide with changes in large language model (LLM) performance. Determine whether higher temperature or power spikes align with lower decode speeds at the same time. The CSV logs that you collected in $WORK/data/ contain timestamps to help you correlate events.
The power series estimates total battery discharge. Repeat the benchmark under the same conditions before attributing variation to throttling or to the application.
Temperature over time
Whole-device battery power over time
Inspect memory usage
The resident set size stays fairly constant during this run, except for five sharp troughs. These troughs coincide with temperature and power spikes.
Determine whether these troughs align with the timestamps at which new conversations started. In llm-perf.csv, you can align the elapsedSeconds field of each inference with the time axis of the plot. The number of troughs alone doesn’t establish a relationship. Record the conversation start times and repeat the benchmark to check whether the pattern occurs consistently.
Resident memory over time
Draw your own conclusions about the data that you’ve collected. Your graph might look slightly different depending on your device and backend.
What you’ve accomplished
You now have the skills to interpret the data from your runtime performance analysis. You have a full performance analysis pipeline from data gathering to result interpretation for LiteRT-LM based applications.
You can make this process more detailed and efficient by adding in new measurements or automating application usage.