The smallest self-improving program The goal is to write a program that learns from its own mistakes, and improves itself based on it. This means, that later attempts at the problem should be either faster or more accurate, than earlier ones. 

To deny trivial solutions, here is a set of rules (they are rather obvious):


you can choose the problem to be solved, but your choice will be voted upon.
the program should read input, this means the problem must have input variables, and its output should depend on that input.
later runs of the algorithm should be better (at least after a certain number of runs) than the previous ones. Better can mean faster, or more optimal, or more accurate.
the improvement must be real, and not just the disabling of purposefully introduced inhibitors like if (never_run_before()) sleep(100);
the improvement must be caused by your program, and not external factors (like the OS giving faster access to a resource, if it was already opened or more often accessed before)
the iterations can be either successive runs of the program while you save knowledge to a non-volatile storage, or you can have an interactive program which reads input again and again for successive runs of the algorithm.
there should be improvement besides the situation where the algorithm runs faster given the exact same input data. (just storing previous results and doing nothing else would be too cheap). This means, there should be some improvement even if there is no repetition in the input data, for example if the task is to solve a maze, the input maze might be different each time.
the algorithm must be part of your program, so the use of existing machine-learning tools is not allowed (otherwise it would be a too easy win for Matlab and its built-in neural network)


The score is: number of characters - 5 * score form votes. It can be negative. Smallest wins. Winner will be selected not sooner than 10 days after the first valid solution, and has to have a positive vote score.

For voters: the golfing is already an independent part of the score, so pleas don't vote based on the amount of golfing, but on the cleverness of the solution and the hardness and originality of the chosen problem (a program playing a game against the user should worth more than a program calculating the digits of pi)
GNU Octave / MATLAB, 14

f=@(n)n+sin(n)


You don't generally take a standard input with Octave programs, so this is a function which gives an improved estimate of pi after every call on its previous output. Sample run:

octave&gt; f=@(n)n+sin(n);
octave&gt; format 'long'
octave&gt; n = 1;
octave&gt; n = f(n)
n =  1.84147098480790
octave&gt; n = f(n)
n =  2.80506170934973
octave&gt; n = f(n)
n =  3.13527633289972
octave&gt; n = f(n)
n =  3.14159261159065
octave&gt; n = f(n)
n =  3.14159265358979