I am stuck at an implementation of a scientific paper's algorithm, could I ask help from staff to code a part with me or even my advisor to do so?

Thanks for the clarification.

  • 4
    My experience has shown that the answer to this question is no, because it is only your job. So I suggest you do your best. – user0410 Apr 2 at 19:40
  • 28
    Get advice from staff or faculty, especially your advisor, but do not expect them to actually do the thing themselves. The goal is for you to figure out how to do it... That is, the implementation itself is not the educational goal for you, but, rather, that you implement the thing. But/and part of your advisor's role would be to help (not quite "do"). – paul garrett Apr 2 at 19:45
  • 19
    Being stuck is something very much different from lacking sufficient manpower ("needs more than one pair of hands"). Could you please clarify which of these problems you're facing? – Jochen Glueck Apr 2 at 21:14
  • 2
    Who are the people you refer to as staff? What is your position? – user2705196 Apr 3 at 19:11
  • 1
    Is your issue more that the paper didn't explain how to implement it (replicability), or that it did but you just don't know how to implement that in code? or both? If there's a replicability issue, did you contact the authors, look at their github, etc.? Have other people confirmed they can replicate the result? Are you trying to replicate a leading-edge SOTA result, or something basic from like 5+ years ago? Not enough specifics in your question. In some fields, there is a lot of gaming in papers, researchers omitting or concealing key details for replication. – smci Apr 5 at 1:01

I'd like to add to Buffy's answer and some of the comments: It does happen that the difficulty is in the paper rather than the one sitting before it.

I've had a situation where our Master student couldn't figure out how to get an algorithm from a paper working. Neither could I. We decided that they should go on and use a different approach.
I later on met some industry people on a conference who cited the very same paper for one of their products and talked to them about the paper. Turned out, neither had they succeeded with that algorithm...

As Buffy says, yes, do ask your supervisor. They anyways need to know of your difficulties.

  • 2
    Very much yes! Scientific papers generally have to be compressed to fit into a journal's allowed page length. The authors thus may leave out a lot of explanation, and indeed, might not be all that good at explaining stuff in the first place. (I know I'm not :-() One other thing to do is to check the authors' web sites, since they sometimes have more explanations, or even working examples. – jamesqf Apr 3 at 18:10
  • 2
    @jamesqf: I omitted the master student's unsuccessful attempts to contact the authors about clarification... – cbeleites unhappy with SX Apr 3 at 19:13
  • 3
    May I ask you which algorithm / paper your student was not able to implement? (out of pure curiosity) – user7427029 Apr 3 at 21:11

Yes you can ask, but whoever you ask, make sure you check with your advisor first so that you understand the requirements. The answer might be "do it yourself" of course.

But more likely is that, while they leave the task to you, they might point you to some resource that will help you do it. One principle that is important in teaching is to give the students sufficient hints so that they learn how to do things themselves, rather than just giving solutions.

In fact, rather than a direct ask for help, tell the advisor that you are stuck at a certain point and ask for advice about how to get unstuck.

In some fields, it can be appropriate to have others do certain coding tasks. I doubt that they let grad students directly code the Large Hadron Collider at CERN, for example. It isn't a place where you want to hear "oops...".

In general, you can ask for whatever help you need. But not asking and getting outside help could be interpreted by an advisor as misconduct.

  • 9
    +1 to "In fact, rather than a direct ask for help, tell the advisor that you are stuck at a certain point and ask for advice about how to get unstuck." Your supervisor may be unhappy with a blunt statement of "I can't do this"; they are likely to be much happier with "I completed steps A and B; I am stuck on step C; I tried X, Y and Z and consulted resources P, D, and Q, but I haven't been able to make further progress". – Ben Bolker Apr 2 at 22:33
  • 1
    I’d add that even just explaining the problem to someone (maybe even a fellow student) will help. Either you’ll become unstuck or you’ll realise your problem is real. – Pam Apr 3 at 15:53
  • 1
    @Pam In the IT vernacular, it's called "rubber duck debugging" (not to be confused with similar-sounding "rubber hose debugging", which is a method used to save time on solving hard problems that others have already solved) – mishan Apr 3 at 17:03
  • "could be interpreted as misconduct" For a class, perhaps, but for a scientific paper? True, it'd be misconduct if you didn't properly attribute authorship/acknowledgement later (or claimed that the outside help was your own work), but the getting outside help per se as misconduct? Perhaps it's field-dependent, but at least in biomedical, no one expects papers to be the work of a lone genius. -- You may annoy your/their advisor by complicating the author list or taking time from the other person, but those are political issues, not misconduct. – R.M. Apr 3 at 17:37
  • 3
    @Buffy I can assure you large parts of code that keep the accelerators and detectors going at CERN are most certainly written by grad students. The code tends to be not very good(TM), but that has never stopped physics, though it might have come close a couple of times ;-) – Marianne013 Apr 3 at 23:53

The question is sufficiently vague that I'm not sure why everyone is assuming that your advisor has set you with a goal to implement something from a paper and no one else can touch it because it's a learning experience for you.

Of course you can ask for help from your group - that's why we work in groups. You should definitely ask your advisor who could help you.

In more experimental fields and depending on the scope of the work, your advisor would want to assign a staff member that is paid off the appropriate grant. But generally speaking, assisting someone else with code is a completely normal task that could fall under a staff person's duties if their manager (your mentor) set them to it.

  • 1
    This is an important point. The "assignment" might be meant as a learning exercise, but the supervisor might have believed it's the easiest way to achieve some goal. If it's harder than the PI thought, perhaps other options now have a more favorable cost-benefit profile. – Matt Apr 4 at 21:01

Yes, you should ask for help

Assuming you are more-or-less proficient in coding, it is possible (even likely) that the problem is with the paper itself. In that case you will definitely need your supervisor to help figure this out.

This is part of the reason why I constantly disagree with people saying "post the source" for academic papers. There's no guarantee that what they implemented for their research matches the paper they published. If you implement the algorithm from the paper, you'll catch methodological errors like that.

I've personally had this where my company had paid for the rights to a paper published by a very senior person in the field. His work is repeatedly referenced by a lot of other authors. He should have been top notch.

Instead what we found was that of the 9 papers he'd written on his results, and the 5 separate circuits implementing his algorithm, not one of the circuits corresponded to any of the papers. Not one. When we called him to ask about this, it turns out there was an issue at lower frequencies which the changes in the circuits were intended to resolve.

Except that it turns out these changes invalidate the conclusions of the paper. They added a non-linear element which his algorithm could not deal with. And when we looked at his results, it was absolutely there in the data. He'd only managed to conceal it by quoting his numbers for something like 5% accuracy plus a long-term drift over time, when the field would consider 0.1% accuracy as just about adequate and would not tolerate any control loop drift.

It's possible that he was sloppy and didn't look for this. Or it's possible he raced to publication and thought her could solve the flaws in a later paper. Or it's possible he sold it to us knowing it was crap and simply not caring. If you can't reproduce results, don't discount the possibility that this is what you're dealing with. And if that's the case, you really need to work it out.

  • 2
    Why is that an argument against posting the source? – Azor Ahai -him- Apr 3 at 14:51
  • 6
    Though, I personally disagree with your conclusion about posting the source. The reason people post the source is not so that everyone will blindly use the source rather than reimplementing, but rather that when we struggle to reimplement, we can look at the source to see how the authors got the numbers in the paper. Without posting the source, authors can just say "you must have a bug, I don't have time to help you", and it is much harder to prove that the paper is wrong. – cag51 Apr 3 at 18:02

As a PhD student, I had this problem - the solution turned out to be to call the paper authors for help. One group just sent me their code, which was nice. Another clarified some bits I was doing wrong. I think I remember that one had a typo in the paper, but that might be wishful memory.

However, I would also say I came up in an enviroment where my supervisor definately knew if I was having problems and generaly knew what those problems were because my first action on having a problem was normally to wander into his office and thrash it out on the whiteboard. If you don't have this type of relationship then I suggest you work towards it.

  • Nice infos to know thanks ! – marc nicole Apr 5 at 21:09

Your Answer

