Live data from Hacker News

Differences between the word2vec paper and its implementation

github.com

61–70 of 156 posts

Re: Differences between the word2vec paper and its implementation

#61

Earlier quoted context omitted.

This sort of thing is aggravating to read. Frankly it comes off as really entitled. As researchers, the expectation is now that we not only have to do the research and write a paper like the good old days, but we have to release the code too. Okay, fine. But now that's not enough either -- the code has to be well-documented and clean. Ugh, alright, fine -- it's going to take me a few extra weeks of not doing research…

Pardon me, maybe I just misunderstood the whole idea of research but what good is it if it's not reproducible? I can understand it may be part of a meaningful personal journey for you, and I appreciate that. But if no one else can validate your research they're correct to discredit it and you. So what is the optimal outcome here? Should we hold you to a standard of reproducibility even if it is as minimal as, "actual…

> what good is it if it's not reproducible?

I am one of those people who actually did the extra weeks/months to properly test/review/document/release my code and data sets (you can apt-get install my "research artifacts").

In retrospect, it was a poor use of my time and a poor use of my sponsoring institution's time. "apt-get install" is NOT what we mean by "reproducible" in science.

High-quality or easy to install code is not necessary for a result to be reproducible. True reproduction would mean coding the algorithm from scratch by following the written description, and that's what it literally means in most other fields of science.

You can't download & install a Large Hadron Collider in an afternoon. Does that mean the LHC experiments are "not reproducible"? Of course not.

But that's not even the important point. The really important point is that, in most cases, high-quality code is not even sufficient for a result to be reproducible! See: the article we're discussing.

IMO, the "blindly rerun the code" definition of reproduction is actually a HUGE barrier to creating a true culture of reproducability in computer science. It results in super lazy reviewing where "public source code that's easy to install and puts the correct-sounding shit into STDOUT" becomes a stand-in for "paper actually describes a novel idea in enough detail that it can be truly reproduced".

> So what is the optimal outcome here?

An optimal allocation of scientists' time and effort.

As a scientist who has actually done that leg work, I don't think packaging code so that it runs with a single click is the best use of public money in science in 99.9999% of cases. That time is much better spent on writing and other dissemination explaining the ideas that make the code work (in some cases well-documented source code is the best description but in other cases prose is much more effective and illuminating). Or on coming up with new ideas that are even better than the old ones.

Which I guess is just another way of saying that scientists should spend their time on science, not engineering.

P.S. When shitting on "scientists" for not being good enough software engineers, please remember who's going to be doing the actual work you're demanding. It's mostly phd students who make $30K/yr. And they have to do this work in their free time because their 60 hr/wk day job is fully allocated to doing the actual science. I.e., treat scientists who maintain their code as you would treat FOSS contributors who are making 5x-10x+ less than you while working longer hours. Because maintaining high-quality code is something they are almost certainly doing in their free time.

Re: Differences between the word2vec paper and its implementation

#62
post #52

Earlier quoted context omitted.

Pardon me, maybe I just misunderstood the whole idea of research but what good is it if it's not reproducible? I can understand it may be part of a meaningful personal journey for you, and I appreciate that. But if no one else can validate your research they're correct to discredit it and you. So what is the optimal outcome here? Should we hold you to a standard of reproducibility even if it is as minimal as, "actual…

Pardon me, maybe I just misunderstood the whole idea of "reproducible" but it is only not reproducible if you tried to implement the ideas described in the paper yourself, and I mean really tried, and contacted the authors for help, and still failed to achieve the claimed results.

> if you tried to implement the ideas described in the paper yourself, and I mean really tried, and contacted the authors for help, and still failed to achieve the claimed results.

This is the actually important definition of "reproducible".

"has an install.sh" is really nice, but it's far more important that an informed reader can recreate the artifact for themselves from the written description.

The "must be able to apt install or it's not real science" is a particularly dangerous path to go down. It's how you end up with e.g. shit loads of well-engineered LISP or FORTRAN code with no actual scientific insights or knowledge transfer. Which has actually happened in the past. A lot.

Re: Differences between the word2vec paper and its implementation

#63
post #53

Earlier quoted context omitted.

You're right, I misread that part.

throwaway287391 it's hilarious how much you value your own opinion. You feel it's important your interlocutor knows you know you were corrected, while remaining anonymous. This is like, the funniest thing i've seen all week. You should run for office. _edit_ Mmmm delicious downvotes. How many alts do you have throwaway287391? i don't think dang would or should expose you. But it is even more funny to me that you woul…

I don't have much to say to most of this, but I'll point out that I didn't and couldn't have downvoted you as none of my throwaways have >=500 karma or whatever the threshold is.

Re: Differences between the word2vec paper and its implementation

#64
They're not really that different.

There's only a second vector for a word in the (common, default) negative-sampling case, where each predictable word has a distinct "output node" of the neural network, and the second vector is the in-weights to that one node. Still, most implementations don't emphasize this vector – the classic "word-vector" is a word's representation when it's a neural-network input. And in the hierarchical-softmax training mode, there's no clear second vector.

I suspect the original word2vec authors left out a clearer description of the initialization as they were following some oft-assumed practices implied by their other descriptions.

Another minor difference between the literal descriptions, and original C implementation, was a slightly different looping order in skip-gram training: holding a target-word, and then looping over all context-words, rather than holding a context-word, then looping over all neighboring target-words. One of the authors once mentioned that the shipped approach was slightly more efficient – maybe it was due to CPU cache issues? In any case all the same context->target pairs get trained either way, just in a slightly different order.

Re: Differences between the word2vec paper and its implementation

#65

Earlier quoted context omitted.

This sort of thing is aggravating to read. Frankly it comes off as really entitled. As researchers, the expectation is now that we not only have to do the research and write a paper like the good old days, but we have to release the code too. Okay, fine. But now that's not enough either -- the code has to be well-documented and clean. Ugh, alright, fine -- it's going to take me a few extra weeks of not doing research…

I have spent enough time to debunk papers to know that a lot of researchers are shamelessly cheating or make mistakes (as EVERYBODY does). Reviewing your code should be part of the peer review process. Sorry but I don't trust your research just based on yours words and cherry picked images. Also research is incremental, so producing a proper code on which other can work on top of should be part of the CONTRIBUTION.

I fully agree, and would actually go a lot further.

A very large number of research papers I've read in my life were so poorly written as to being near impossible to understand.

The time it took to infer the actual meaning of certain parts of certain papers was vastly larger than just reading the code would have been.

It has become very clear to me that being a strong CS researcher does not necessarily imply mastery of language or even the very basic ability to explain one's ideas. As a matter of fact, with very few exception (eg Feynmann), the two skills seem to be at odds with one another.

On the other hand, code can be read and understood much more readily, especially when it can be experimented with, if only to insert printfs in it to understand what it does.

The culture of scientific publication in CS must change. The "I'm pressured by my advisor and therefore have no time to publish my code" argument is complete bollocks.

The code should come first and your advisor should pressure you to publish that first (assuming it actually works).

If someone wants to read your poorly worded explanation of how it works, fine, publish a paper.

Show me the code first.

Re: Differences between the word2vec paper and its implementation

#66
post #28

Earlier quoted context omitted.

Then some other academic can get credit for publishing a rigorous paper describing the actual algorithm, explaining why the original paper is wrong (without speculating on the motive, just the facts), and why the approach taken in the code is in fact better. Bonus points for describing a further improvements, with working code.

In machine learning, you don't get credit for publishing rigorous papers. You get credits for publishing papers that show improved performance: One big challenge the community faces is that if you want to get a paper published in machine learning now it's got to have a table in it, with all these different data sets across the top, and all these different methods along the side, and your method has to look like the b…

>It's an extremely, almost exclusively, empirical field.

Fully agree, and it's a necessary disease in young fields like ML (akin to grid search in fact).

But at some point, there will need to be some sort of theoretical foundation brought to bear or advancement will grind down to a halt

And the academic reward mechanism needs to start reflecting that fact.

Re: Differences between the word2vec paper and its implementation

#67
post #53

Earlier quoted context omitted.

You're right, I misread that part.

throwaway287391 it's hilarious how much you value your own opinion. You feel it's important your interlocutor knows you know you were corrected, while remaining anonymous. This is like, the funniest thing i've seen all week. You should run for office. _edit_ Mmmm delicious downvotes. How many alts do you have throwaway287391? i don't think dang would or should expose you. But it is even more funny to me that you woul…

FIY: elsewhere on Earth, admitting to being wrong is considered to be a commendable thing.

Welcome to the planet, enjoy your stay!

Re: Differences between the word2vec paper and its implementation

#68

Earlier quoted context omitted.

I ran into the same thing when implementing a hash table sorting algorithm from a recent paper. Nowhere in the paper does it mention that table size MUST be a power of two. The new table structure is supposedly more memory efficient than anything else out there. That's the whole point of it. So it's nice that they leave out "btw only works with size power of two". I got 2/3 of the way through an optimized implementat…

I think it's ok to names names in this specific instance: you'll save other people a lot of pain.

It's only been implemented ~3 times besides the paper reference and I do too much ranting on HN to risk connecting it to my professional image. Particularly critisicm of big tech companies I may want to work for someday. Sorry.

It's very niche, I doubt many will run into it. Writing your own hash table is generally considered a bad idea :). I was just very bored and annoyed with memory limits. It will only affect implementors, which is less than 5 people in 4 years. Good example of implementor beware though, I'm sure it's a common issue

Re: Differences between the word2vec paper and its implementation

#69
post #53

Earlier quoted context omitted.

throwaway287391 it's hilarious how much you value your own opinion. You feel it's important your interlocutor knows you know you were corrected, while remaining anonymous. This is like, the funniest thing i've seen all week. You should run for office. _edit_ Mmmm delicious downvotes. How many alts do you have throwaway287391? i don't think dang would or should expose you. But it is even more funny to me that you woul…

I don't have much to say to most of this, but I'll point out that I didn't and couldn't have downvoted you as none of my throwaways have >=500 karma or whatever the threshold is.

> I'll point out that I didn't and couldn't have downvoted you as none of my throwaways have >=500 karma

I'll take you at your word.

You want to just drop in and drop bombs and pretend that the information you are presenting is in some sense useful. Other folks pointed out that you are wrong.

But you also want the reputation. You want the respect for revising your opinion.

You're you from your perspective, but from everyone else's perspective you're not you, you're the basest troll that has ever posted on HN, because you have no rep, no history, not provenance.

It's funny to me, because you want it both ways. It's pretty hilarious.

I shouldn't feed the trolls. I know better. Enjoy being a complete waste of time to everyone that glances at your writing!

Re: Differences between the word2vec paper and its implementation

#70

Earlier quoted context omitted.

Pardon me, maybe I just misunderstood the whole idea of research but what good is it if it's not reproducible? I can understand it may be part of a meaningful personal journey for you, and I appreciate that. But if no one else can validate your research they're correct to discredit it and you. So what is the optimal outcome here? Should we hold you to a standard of reproducibility even if it is as minimal as, "actual…

The original idea behind "reproducible" is that the ideas conveyed in the paper should be enough to reproduce the results. Physicists and biologists are not expected to drive over to your lab to figure out what's wrong with your setup. Now, that said, reproducibility is terrible in many fields. CS has an opportunity to act as a trailblazer here, but it should be noted that this would be holding themselves to a higher…

Some pretty good computer science got done before devops was gifted to the world.

And some pretty good science got done before computer scientists were gifted to the world.

I'm genuinely skeptical that modern software engineering practices are a good way of thinking about reproduction in science. Even in computer science. There's a lot that scientists can learn from software engineering (and in fact I've helped run workshops in the past on exactly this topic), but science is not engineering.

Post reply on HN