Does showing more lines make the engine compute lines that it otherwise wouldn't have (and thus decrease overall performance)? If I show 1 line vs 5 lines, is there a difference? My guess is no, but I'm uncertain about how these engines work.
Does showing more lines make the engine compute lines that it otherwise wouldn't have (and thus decrease overall performance)? If I show 1 line vs 5 lines, is there a difference? My guess is no, but I'm uncertain about how these engines work.
@reddera said in #1:
Does showing more lines make the engine compute lines that it otherwise wouldn't have (and thus decrease overall performance)? If I show 1 line vs 5 lines, is there a difference? My guess is no, but I'm uncertain about how these engines work.
What makes you think that if an engine computes more lines performance is decreased? I'd say the opposite is true.
@reddera said in #1:
> Does showing more lines make the engine compute lines that it otherwise wouldn't have (and thus decrease overall performance)? If I show 1 line vs 5 lines, is there a difference? My guess is no, but I'm uncertain about how these engines work.
What makes you think that if an engine computes more lines performance is decreased? I'd say the opposite is true.
@Abigail-III said in #2:
What makes you think that if an engine computes more lines performance is decreased? I'd say the opposite is true.
No, what they are asking is the processing power. If you have one line you can devote all the resources to calculating the best line. For accuracy, this makes a difference. For human play, it may not help. What happens when your opponent plays the second best move? Also, when you look at multiple lines you will see different moves when the next move might be the best, then there would be multiple lines after that. Depends on what your goals are.
@Abigail-III said in #2:
> What makes you think that if an engine computes more lines performance is decreased? I'd say the opposite is true.
No, what they are asking is the processing power. If you have one line you can devote all the resources to calculating the best line. For accuracy, this makes a difference. For human play, it may not help. What happens when your opponent plays the second best move? Also, when you look at multiple lines you will see different moves when the next move might be the best, then there would be multiple lines after that. Depends on what your goals are.
@Abigail-III said in #2:
What makes you think that if an engine computes more lines performance is decreased? I'd say the opposite is true.
What I do know about engines is that they don't compute every possible line, they try to prune lines that are unlikely to be good in order to focus the computer's resources on computing the more plausible lines. If computing more lines increases performance then they would not prune lines, instead they would compute as many lines as possible, which is not true.
@Abigail-III said in #2:
> What makes you think that if an engine computes more lines performance is decreased? I'd say the opposite is true.
What I do know about engines is that they don't compute every possible line, they try to prune lines that are unlikely to be good in order to focus the computer's resources on computing the more plausible lines. If computing more lines increases performance then they would not prune lines, instead they would compute as many lines as possible, which is not true.
@reddera said in #1:
Does showing more lines make the engine compute lines that it otherwise wouldn't have (and thus decrease overall performance)? If I show 1 line vs 5 lines, is there a difference? My guess is no, but I'm uncertain about how these engines work.
Asking for more lines does make the engine compute (search) lines further than otherwise. What happens is that, if you ask for 'n' lines, then Lichess uses a command Stockfish has called MultiPV to set a variable by the same name to that number of lines.
Then, in search.cpp, there is the comment...
// MultiPV loop. We perform a full root search for each PV line
Stockfish otherwise would have not done a full root search on the PV lines that were not the best.
There is, however, so much caching in the code, that this turns out to not slow the program up so much that I've ever noticed with just 5-lines as the value.
@reddera said in #1:
> Does showing more lines make the engine compute lines that it otherwise wouldn't have (and thus decrease overall performance)? If I show 1 line vs 5 lines, is there a difference? My guess is no, but I'm uncertain about how these engines work.
Asking for more lines does make the engine compute (search) lines *further* than otherwise. What happens is that, if you ask for 'n' lines, then Lichess uses a command Stockfish has called MultiPV to set a variable by the same name to that number of lines.
Then, in search.cpp, there is the comment...
// MultiPV loop. We perform a full root search for each PV line
Stockfish otherwise would have not done a full root search on the PV lines that were not the best.
There is, however, so much caching in the code, that this turns out to not slow the program up so much that I've ever noticed with just 5-lines as the value.
Probably it decreases a tiny bit the performance but not in any significant way because whether the lines are displayed or not they were (and still are) calculated to increase the accuracy and perhaps change the main line.
The only reason it may decrease performance a bit is that sometimes it can start to analyze deeper a line it would have pruned sooner otherwise.
But I'm not a Stockfish developer, so take everything I say with a grain (or sea) of salt!
Probably it decreases a tiny bit the performance but not in any significant way because whether the lines are displayed or not they were (and still are) calculated to increase the accuracy and perhaps change the main line.
The only reason it may decrease performance a bit is that sometimes it can start to analyze deeper a line it would have pruned sooner otherwise.
But I'm not a Stockfish developer, so take everything I say with a grain (or sea) of salt!
@Meowgate said in #3:
No, what they are asking is the processing power. If you have one line you can devote all the resources to calculating the best line. For accuracy, this makes a difference. For human play, it may not help. What happens when your opponent plays the second best move? Also, when you look at multiple lines you will see different moves when the next move might be the best, then there would be multiple lines after that. Depends on what your goals are.
That doesn't make much sense. How would you calculate the "best line" if you limit yourself in the number lines you can investigate? Sure, you could devote all your processing power to the line 1. e3 e5 2. Qh5 Nc6 3 Qxh7 Rxh7, but you'd be better off if you had explored other lines for the first three moves.
Unless you would have an algorithm which knows the best move in any position without calculating any lines.
The more lines you investigate, the better move you can make.
@Meowgate said in #3:
> No, what they are asking is the processing power. If you have one line you can devote all the resources to calculating the best line. For accuracy, this makes a difference. For human play, it may not help. What happens when your opponent plays the second best move? Also, when you look at multiple lines you will see different moves when the next move might be the best, then there would be multiple lines after that. Depends on what your goals are.
That doesn't make much sense. How would you calculate the "best line" if you limit yourself in the number lines you can investigate? Sure, you could devote all your processing power to the line 1. e3 e5 2. Qh5 Nc6 3 Qxh7 Rxh7, but you'd be better off if you had explored other lines for the first three moves.
Unless you would have an algorithm which knows the best move in any position without calculating any lines.
The more lines you investigate, the better move you can make.
@reddera said in #4:
What I do know about engines is that they don't compute every possible line, they try to prune lines that are unlikely to be good in order to focus the computer's resources on computing the more plausible lines. If computing more lines increases performance then they would not prune lines, instead they would compute as many lines as possible, which is not true.
The more lines you investigate, the better your prune decisions will be.
@reddera said in #4:
> What I do know about engines is that they don't compute every possible line, they try to prune lines that are unlikely to be good in order to focus the computer's resources on computing the more plausible lines. If computing more lines increases performance then they would not prune lines, instead they would compute as many lines as possible, which is not true.
The more lines you investigate, the better your prune decisions will be.
@Abigail-III said in #7:
That doesn't make much sense. How would you calculate the "best line" if you limit yourself in the number lines you can investigate? Sure, you could devote all your processing power to the line 1. e3 e5 2. Qh5 Nc6 3 Qxh7 Rxh7, but you'd be better off if you had explored other lines for the first three moves.
Unless you would have an algorithm which knows the best move in any position without calculating any lines.
The more lines you investigate, the better move you can make.
It's called pruning, at every step you have to choose where to better devote your resource that's one of the most crucial point of the algorithm, otherwise it's just brute force and unless you solve the game it's not very useful, example: https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning
@Abigail-III said in #7:
> That doesn't make much sense. How would you calculate the "best line" if you limit yourself in the number lines you can investigate? Sure, you could devote all your processing power to the line 1. e3 e5 2. Qh5 Nc6 3 Qxh7 Rxh7, but you'd be better off if you had explored other lines for the first three moves.
>
> Unless you would have an algorithm which knows the best move in any position without calculating any lines.
>
> The more lines you investigate, the better move you can make.
It's called pruning, at every step you have to choose where to better devote your resource that's one of the most crucial point of the algorithm, otherwise it's just brute force and unless you solve the game it's not very useful, example: https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning
@Abigail-III said in #7:
That doesn't make much sense. How would you calculate the "best line" if you limit yourself in the number lines you can investigate?
That's not how it works. There is something called depth. This is what I was getting at when I said there was only one sequence from the "next" move. Obviously, at the end of a game or with limited options (like being in check) this might not happen, but generally the position is evaluated first. Then we get depth.
To my understanding, a computer can only figure out 7 man positions. Until then, it's guess work. In the beginning, the computer will not give us adequate readings. However, go to a middlegame position and it will have concrete variables to compare the next move.
To the human, this would be like blocking a fork on the king and rook by playing a side pawn (a3, c3, a6, or c6). We don't need to look at the other options. The formula will probably choose c6 or c3. Only black would play c6, only white c3. Then depth comes, what happens after? However, in the list of multiple lines we don't see this unless we specifically request it. I usually see a few different moves.
If you are all about accuracy, then yes, I stated multiple lines given time is the way to go. If you have say +5 advantage in a game, why do you need to evaluate all permutations? If the depth is low and you have the advantage, the computer isn't going to magically get a +6 anytime soon.
Multiple lines only help if things are equal and you give it time. Otherwise, why not use the first advantage that pops up and go for pattern recognition? Do you really want to find all the nuances of a KGA?
@Abigail-III said in #7:
> That doesn't make much sense. How would you calculate the "best line" if you limit yourself in the number lines you can investigate?
That's not how it works. There is something called depth. This is what I was getting at when I said there was only one sequence from the "next" move. Obviously, at the end of a game or with limited options (like being in check) this might not happen, but generally the position is evaluated first. Then we get depth.
To my understanding, a computer can only figure out 7 man positions. Until then, it's guess work. In the beginning, the computer will not give us adequate readings. However, go to a middlegame position and it will have concrete variables to compare the next move.
To the human, this would be like blocking a fork on the king and rook by playing a side pawn (a3, c3, a6, or c6). We don't need to look at the other options. The formula will probably choose c6 or c3. Only black would play c6, only white c3. Then depth comes, what happens after? However, in the list of multiple lines we don't see this unless we specifically request it. I usually see a few different moves.
If you are all about accuracy, then yes, I stated multiple lines given time is the way to go. If you have say +5 advantage in a game, why do you need to evaluate all permutations? If the depth is low and you have the advantage, the computer isn't going to magically get a +6 anytime soon.
Multiple lines only help if things are equal and you give it time. Otherwise, why not use the first advantage that pops up and go for pattern recognition? Do you really want to find all the nuances of a KGA?