Constraint the numeric outputs softly

I want the average of multiple input numbers and output numbers to follow a specific number.
Of course, there are several exisiting methods such as L1 and MSE. But since I’m working on the task dealing with long sequences, I want to induce the model to follow that particular number.
Suppose a given number is 0.3, and the average is 0.4. Then, instead of making the mean precisely 0.3, I would like to give the model a kind of penalty so that it can infer fewer values.

Thank you

Your input and output is not very clear to me. Can you provide an example input sequence, the expected output and how the output is computed in this case?