Skip to content

FastChat-T5 4K context #1711

Open
Open

Description

@tutankhamen-1

lmsys.org states that FastChat-T5 supports a context size of 4K. How do I get it to work? I get an error as soon as I go above 2K.

Activity

  1. self-assigned this
    on Jun 15, 2023
  2. added
    bugSomething isn't working
    documentationImprovements or additions to documentation
    and removed
    bugSomething isn't working
    on Jun 15, 2023
  3. DachengLi1 commented on Jun 15, 2023

    @DachengLi1
    Collaborator

    It can encode 2K tokens, and output 2K tokens, a total of 4K tokens. But it cannot take in 4K tokens along. @tutankhamen-1. In contrast, Llama-like model encode+output 2K tokens.

  4. tutankhamen-1 commented on Jun 16, 2023

    @tutankhamen-1
    Author

    It can encode 2K tokens, and output 2K tokens, a total of 4K tokens. But it cannot take in 4K tokens along. @tutankhamen-1. In contrast, Llama-like model encode+output 2K tokens.

    That’s great, but the 2K total limit seems to be hardcoded in many places and I can’t get it to work. I’m trying to use it through the API.

  5. DachengLi1 commented on Jun 16, 2023

    @DachengLi1
    Collaborator

    The current behavior should be correct? It can only encode 2K tokens, which is the hardcoded places you see. But it can output another 2K tokens. If you use Llama (vicuna), it can encode 2K tokens, but when you give 2K tokens to it, it cannot output anything.

  6. tutankhamen-1 commented on Jun 16, 2023

    @tutankhamen-1
    Author

    This is the error message I get:

    This model's maximum context length is 2048 tokens. However, you requested 2302 tokens (1790 in the messages, 512 in the completion). Please reduce the length of the messages or completion.

    Model: fastchat-t5-3b-v1.0

  7. DachengLi1 commented on Jun 16, 2023

    @DachengLi1
    Collaborator

    @tutankhamen-1 Thanks for letting us know! We will fix it.
    @merrymercy Let's change the error message for T5?

  8. Taytay commented on Jun 30, 2023

    @Taytay

    Isn't this limit arbitrary for t5 due to its attention mechanism? My understanding is that it uses quadratic memory as the context length goes up, but as long as you have the ram to support it, a longer context length isn't limited by the model itself.

  9. merrymercy commented on Jul 5, 2023

    @merrymercy
    Member

    @tutankhamen-1 Could you help us fix the bug and contribute a pull request?

  10. added
    bugSomething isn't working
    and removed
    documentationImprovements or additions to documentation
    on Jul 5, 2023
  11. chessing234 commented on Jun 10, 2026

    @chessing234

    The API context check was treating T5 like a causal model and subtracting prompt tokens from the completion budget. Opened #3885 to validate encoder and decoder lengths separately for T5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions