Giter Site home page Giter Site logo

Comments (7)

scharoun avatar scharoun commented on June 4, 2024

transformer-based model seems need more layers? so, it must affect inference performance?

from returnn-experiments.

albertz avatar albertz commented on June 4, 2024

Hi,

Yes, Transformer can train faster, although our models are often quite big, and seems to need longer to converge, and also we have a very fast native CUDA LSTM implementation, so that in the end there is not too much a difference. But maybe @kazuki-irie can comment more on that.

For inference, Transformer models are usually slower. Also, there is some quadratic component in the runtime/memory complexity, which dominates at some point (for some longer seq length). Maybe @kazuki-irie or @curufinwe can give some more details on that.

from returnn-experiments.

kazuki-irie avatar kazuki-irie commented on June 4, 2024

I suppose the original question was about the encoder decoder ASR models (not language models, correct?).
So I do not think I have anything I can add to @albertz's answer.

from returnn-experiments.

albertz avatar albertz commented on June 4, 2024

Ah, sorry, I somehow assumed LM models. But for the ASR models, the situation is very similar, so what I said should be correct as well. For training times, you can also see our ASRU paper where we compare Transformer vs LSTM for ASR.

from returnn-experiments.

scharoun avatar scharoun commented on June 4, 2024

@albertz Thanks for your reply! Did you compare inference time?

from returnn-experiments.

albertz avatar albertz commented on June 4, 2024

We did, but I'm not sure if we have some tables showing systematic comparisons. But what I said is also what we observed in experiments:

For inference, Transformer models are usually slower. Also, there is some quadratic component in the runtime/memory complexity, which dominates at some point (for some longer seq length).

The quadratic component cannot really be changed, unless you change the model. So the original model will never work on long sequences. But there are various solutions to that, which modify the Transformer model, to get rid of the quadratic component.

Even considering some maximum seq length, the Transformer model is slower, and takes more memory. This can be reduced by less self attention in the model. But the question is how to do that while still keeping good performance. @kazuki-irie is working on that.

from returnn-experiments.

scharoun avatar scharoun commented on June 4, 2024

@albertz Thank you, i get it

from returnn-experiments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.