Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two reproducibility issues due to lack of tie-breaking #20

Open
sscdotopen opened this issue Sep 10, 2023 · 0 comments
Open

Two reproducibility issues due to lack of tie-breaking #20

sscdotopen opened this issue Sep 10, 2023 · 0 comments

Comments

@sscdotopen
Copy link

I found two bugs in Serenade, which lead to reproducibility issue, where the recommender system returns different results when executed with the same inputs. Both are caused by a lack of tie breaking during sorting or top-k aggregation.

The first issue is in https://github.com/bolcom/serenade/blob/main/src/io.rs#L48 which loads test sessions from a CSV file. Here the session entries are sorted by timestamp. The code does not handle cases where several entries have the same timestamp and puts such entries in random order across different executions. A fix is for example to sort by item id in addition for equal timestamps.

The second issue is in https://github.com/bolcom/serenade/blob/main/src/vmisknn/vmis_index.rs#L395 . This code iterates over the session similarities which are stored in a hash map and extracts the top-k entries via a heap. The iteration order over a hashmap is not defined and changes in a non-deterministic way during repeated executions for the same data. If several sessions with the same score are present, there can be case where the selection which of them to put into the top-k entries of the heap changes non-deterministically as well (as it depends on the iteration order). A fix here is to for example sort the keys before iterating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant