def METHOD_NAME(self) -> bytes:
    # We serialize this as a dict in order to track the key(s) a SpanGroup
    # is a value of (in a backward- and forward-compatible way), since
    # a SpanGroup can have a key that doesn't match its `.name` (See #10685)
    if len(self) == 0:
        return self._EMPTY_BYTES
    msg: Dict[bytes, List[str]] = {}
    for key, value in self.items():
        msg.setdefault(value.METHOD_NAME(), []).append(key)
    return srsly.msgpack_dumps(msg)