Live data from Hacker News

Show HN: Word2Bits – Quantized Word Vectors

github.com

111–113 of 113 posts

Re: Show HN: Word2Bits – Quantized Word Vectors

#111

Earlier quoted context omitted.

Our problem is not about auto-completion (we're not dealing with that much data to need sophisticated algorithms for that). What we're doing with our NN is ordering the set of results (matches) we already have. In other words, we're assigning a relevance number in [0, 1] to each result, based on the query string and training based on past user choices (clicking a result). In order to maintain some consistency and rob…

Ah ok I think I get it. So herein lies the problem (let me know if any of this is incorrect): you want to encode fragments of a word similarly to completed versions of the word, without doing inference. The easiest way of augmenting your training data into a word2vec embedding with artificially misspelled inputs doesn't seem like it would work considering how many misspellings there are per word. I think the best way…

Ah, so your first suggestion would be basically building an auto-encoder based on training data with correct and incorrect words (fragments). This might work, but it would require a lot of computation: Each word of the vocabulary multiplied by all its similar counterparts. And this wouldn't cover new/unknown terms yet.

What we ended up doing for now is a two-dimensional input layer with per-column one-hot encoding of characters (i.e. one character is one column, 128 rows for the ascii alphabet). Then, apply a convolution with kernel dimensions 3x128, which flattens data to one dimesion and combines three neighboring characters. The second part builds an "assiciation" between neighbors, which helps yielding similar outputs for similar word fragments.

This works quite well, except for some nasty limitations:

- Search queries have a hard limit in length, caused by our input layer dimensions

- Due to varying search query length, input nodes on the right side are often unused/zero, leading an weighting bias on the left side when training. That is, the start of search queries receives more attention that the end. But that's not necessarily a bad thing.

Re: Show HN: Word2Bits – Quantized Word Vectors

#112

Earlier quoted context omitted.

Ah, so we'd divide our word (fragment) into parts and treat the parts like words for usage with CBOW or skipgram?

Uh yeah I have no idea if it'd perform well, but instead of having a sparse vector with the one-hot encoding of 'cargo', you enter a sparse vector with the 'car', 'arg' and 'rgo' dimensions set high. Top of my head speculation, I never tried this...

Ah, that's actually not too far idea-wise from what we ended up doing: https://news.ycombinator.com/item?id=16637525

Re: Show HN: Word2Bits – Quantized Word Vectors

#113
post #109
post #105

Earlier quoted context omitted.

Hm what do you mean? I'm not quite seeing how to differentiate with respect to the quantization steps.

Say you have a function f(q(x)) where q quantizes x into one of s_1, ..., s_n. Then if q(x) = s_i for a certain x, df/ds_i = df/dq and df/ds_j = 0 for all j != i. That breaks down for values of x precisely at the boundary between steps, so I should have qualified "differentiable" with "almost everywhere". It also occurs to me that this might interact strangely with the approximation dq/dx = 1, but since the quantizat…

That's definitely an interesting idea -- it seems this would allow for boundaries that "change" along with the data (instead of having static boundaries as it is). Would be interested to know how that turns out!
Post reply on HN