Skip to content

Conversation

@minettekaum
Copy link

Description

ZipAr algorithm added

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

There aren't tests implemented for this algorithm yet.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment @cursor review or bugbot run to trigger another review on this PR

The index of the token in the last column of the last completed row.
"""
# We get its index from the number of completed rows, i.e. the index of the first active row
return self.active_rows[0] * self.num_cols - 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect proxy token selection for new rows

The get_proxy_token_idx_for_new_row method returns the last token of the last completed row, but when starting a new row N, the proxy token should come from the previous row N-1 (which is still being generated), not from the last completed row. The formula active_rows[0] * num_cols - 1 gives the wrong row when multiple rows are active. For example, when starting row 2 with active_rows = [1, 2], it returns the last token of row 0 instead of row 1, violating the spatial adjacency principle described in the ZipAR paper.

Fix in Cursor Fix in Web

attentions=decoder_attentions, # type: ignore
hidden_states=decoder_hidden_states, # type: ignore
past_key_values=outputs.past_key_values,
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Wrong scores returned in generation output

The GenerateDecoderOnlyOutput returns scores=scores and logits=raw_logits, but the code builds raw_scores at line 651 which should be used instead of scores. When output_scores is enabled, raw_scores is constructed as a tuple containing the final scores, but the return statement uses the unwrapped scores variable instead. This inconsistency means the output format doesn't match the expected tuple format for scores when return_dict_in_generate and output_scores are both enabled.

Fix in Cursor Fix in Web

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

This PR has been inactive for 10 days and is now marked as stale.

@github-actions github-actions bot added the stale label Dec 2, 2025
@github-actions github-actions bot closed this Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants