Hello!
I've run into some very puzzling webppl behavior, and I was wondering if anyone had insights?
I was running variational inference and kept noticing that certain responses kept being preferred after different runs even when they weren't supported by the data. After tracing it back, I realized that this systematic bias was there even before running Optimize -- it was somehow coming from the prior, and was exactly the same across lots of random seeds!
This was hard for me to understand, because the prior is just a DiagCovGaussian over matrix elements, which should place independent Gaussian priors on each of the elements. The values of interest are deterministic functions of multiple matrix elements (specifically, normalizing over several possible conjunctions of matrix elements), so in expectation, the prior predictive over these downstream values ought to also be independent, not systematically skewed.
The most puzzling part is that the expectations of the individual matrix cells don't seem to differ dramatically under the prior, and the expectations of the individual conjunctions don't either. It's only after you normalize that you get these really systematically biased expectations... The bias also gets bigger when you increase the sigma on the DiagCovGaussian prior. At first, I thought that it was just that the expectation of the normalized values is more unstable, but it comes out almost exactly the same across runs (and I'm taking a lot of samples in the expectation!)
I've got a minimal working example here in <50 lines of code, which can be run on
webppl.org, and would be grateful for any insights!
https://gist.github.com/hawkrobe/4c04410f7142d642f1abea98de6be499
Thanks in advance,
Robert
PS if the model seems unmotivated, it may help to explain that it's an extremely generic-ified version of a pragmatic language model, where the matrix elements represent how different words load onto different features, and the conjunctions are objects with multiple features. The normalizeRow step represents a listener agent deciding which of the objects to pick after hearing a word. But none of that matters for the behavior.