← Latest papers
🤖 machine learning

A Harmonic Mean Formulation of Average Reward Reinforcement Learning in SMDPs

This contribution presents a novel modified harmonic mean operator to correctly compute average reward rates in non-stationary semi-Markov decision processes, thereby enabling robust model-free reinforcement learning algorithms that overcome the limitations of existing ratio-based approaches.

Original authors: Erel Shtossel, Alicia Vidler, Uri Shaham, Gal A. Kaminka

Published 2026-05-07
📖 5 min read🧠 Deep dive

Original authors: Erel Shtossel, Alicia Vidler, Uri Shaham, Gal A. Kaminka

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

The Big Picture: The "Speedometer" Problem

Imagine you are a delivery driver trying to figure out which route is the fastest. You have two options:

  • Route A: You drive 10 miles in 10 minutes.
  • Route B: You drive 20 miles in 20 minutes.

Both seem to require the same time per mile (1 minute per mile). But what if traffic changes? What if Route A is fast on Monday but gets stuck in a 2-hour traffic jam on Tuesday, while Route B remains constant?

In the world of Artificial Intelligence (AI), specifically in Reinforcement Learning, agents (like robots or trading bots) must learn the best "average speed" (reward rate) over a long, endless journey. The paper argues that the current tools AI uses to calculate this average speed are broken when the journey is unpredictable.

The Old Way: The "Average of Averages" Error

The paper examines two existing methods (called SMART and Relaxed-SMART) that attempt to calculate the best average speed.

  • The Flaw: These methods calculate average speed by dividing the total distance traveled by the total time spent.
    • Analogy: Imagine you drove 100 miles in 10 hours. You say: "Okay, your average speed is 10 miles per hour."
    • The Problem: This works well if your speed is constant. But if your speed changes wildly (sometimes you are stuck in traffic for hours, sometimes you race down the highway), a simple division of total distance by total time can yield a misleading number. It treats a 10-minute trip and a 10-hour trip simply as "two trips," without recognizing that the timing of the reward matters.

The authors show that the old methods calculate the mathematics incorrectly when your rewards (earned money) and your time (how long an action takes) are linked (e.g., you only get large rewards if you wait a long time). They assume the two have nothing to do with each other, like mixing apples and oranges, even though in reality they are often connected.

The New Solution: The "Harmonic Mean"

The authors propose a new way to calculate the average by using a mathematical tool called the Harmonic Mean.

  • The Analogy: Think of a trip to a destination and back.
    • You drive there at 20 miles per hour.
    • You drive back at 40 miles per hour.
    • Wrong Math (Arithmetic Mean): (20+40)/2=30(20 + 40) / 2 = 30 miles per hour.
    • Right Math (Harmonic Mean): Since you spent more time driving at the slower speed (20 miles per hour), your actual average speed for the entire trip is closer to 20 than to 40. The correct answer is approximately 26.7 miles per hour.

The Harmonic Mean is the correct way to average rates (like speed or profit per minute). However, there is a catch: the standard Harmonic Mean breaks down if you have a zero speed (you cannot divide by zero) or if you have negative speeds (driving backward). In real life, AI agents often receive zero rewards or lose money (negative rewards).

The Innovation: The "Modified Harmonic Mean"

To fix the broken mathematics, the authors invented a Modified Harmonic Mean.

  • How it works: Imagine a smart calculator that sorts your trips into three piles:
    1. Positive trips (you earned money).
    2. Negative trips (you lost money).
    3. Zero trips (you broke even).
  • It calculates the "harmonic average" for the positive trips and the negative trips separately. Then it mixes them together and treats the "zero" trips as neutral.
  • The Result: This new calculator can handle messy, real-world data where you sometimes lose money, sometimes earn money, and sometimes stand around doing nothing. It correctly determines the true "speed" of your rewards, even when the environment is chaotic.

The New Algorithm: "Harmonic R-Learning"

Using this new mathematics, the authors created a new AI learning algorithm called Harmonic R-Learning.

  • What it does: It learns how to make decisions in situations where actions take different amounts of time (like waiting for a stock price to rise versus selling immediately).
  • Why it is better: It does not get confused when "reward" and "time" are linked. It recognizes the true value of an action, whereas old algorithms might be tempted to view a slow, risky action as great simply because the total reward was high.

The Proof: Two Tests

The authors tested their new algorithm against the old ones in two scenarios:

  1. The "Fake" Traffic Test: They created a simple computer simulation where one route looked good at first glance but was actually a trap, and another route looked slow but was the winner in the long run.

    • Result: The old algorithms got confused and chose the wrong route. The new Harmonic R-Learning saw through the trick and chose the right one.
  2. The Bitcoin Trading Test: They used real data from Bitcoin trading. Bitcoin is wild; prices jump up and down, and sometimes you hold a position for a long time, sometimes only for a second.

    • Result: When the time spent and the money earned were linked (a common real-world scenario), the new algorithm earned more profit than the old ones. When they were not linked, the new algorithm performed just as well as the old ones, proving that there is no downside to using it.

Summary

The paper says: "The old way of calculating average rewards in AI is like averaging speeds without considering how long you were at each speed. It fails when the world is messy. We have invented a new 'Modified Harmonic Mean' calculator that can handle messy data (zeros and negatives) and provides AI with the correct average speed, helping it make better decisions in complex, time-varying environments."

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →