diff --git a/src/builtin_pb/sentencepiece.pb.cc b/src/builtin_pb/sentencepiece.pb.cc
index 7bc5494..8815276 100644
--- a/src/builtin_pb/sentencepiece.pb.cc
+++ b/src/builtin_pb/sentencepiece.pb.cc
@@ -11,63 +11,56 @@
 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 // @@protoc_insertion_point(includes)
 #include <google/protobuf/port_def.inc>
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SentencePieceText_sentencepiece_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto;
-namespace sentencepiece {
-class SentencePieceText_SentencePieceDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SentencePieceText_SentencePiece> _instance;
-} _SentencePieceText_SentencePiece_default_instance_;
-class SentencePieceTextDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SentencePieceText> _instance;
-} _SentencePieceText_default_instance_;
-class NBestSentencePieceTextDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NBestSentencePieceText> _instance;
-} _NBestSentencePieceText_default_instance_;
-}  // namespace sentencepiece
-static void InitDefaultsscc_info_NBestSentencePieceText_sentencepiece_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_NBestSentencePieceText_default_instance_;
-    new (ptr) ::sentencepiece::NBestSentencePieceText();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
 
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_NBestSentencePieceText_sentencepiece_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_NBestSentencePieceText_sentencepiece_2eproto}, {
-      &scc_info_SentencePieceText_sentencepiece_2eproto.base,}};
+PROTOBUF_PRAGMA_INIT_SEG
 
-static void InitDefaultsscc_info_SentencePieceText_sentencepiece_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_SentencePieceText_default_instance_;
-    new (ptr) ::sentencepiece::SentencePieceText();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SentencePieceText_sentencepiece_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_SentencePieceText_sentencepiece_2eproto}, {
-      &scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto.base,}};
-
-static void InitDefaultsscc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_SentencePieceText_SentencePiece_default_instance_;
-    new (ptr) ::sentencepiece::SentencePieceText_SentencePiece();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto}, {}};
+namespace _pb = ::PROTOBUF_NAMESPACE_ID;
+namespace _pbi = _pb::internal;
 
+namespace sentencepiece {
+PROTOBUF_CONSTEXPR SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(
+    ::_pbi::ConstantInitialized)
+  : piece_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , surface_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , id_(0u)
+  , begin_(0u)
+  , end_(0u){}
+struct SentencePieceText_SentencePieceDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR SentencePieceText_SentencePieceDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~SentencePieceText_SentencePieceDefaultTypeInternal() {}
+  union {
+    SentencePieceText_SentencePiece _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SentencePieceText_SentencePieceDefaultTypeInternal _SentencePieceText_SentencePiece_default_instance_;
+PROTOBUF_CONSTEXPR SentencePieceText::SentencePieceText(
+    ::_pbi::ConstantInitialized)
+  : pieces_()
+  , text_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , score_(0){}
+struct SentencePieceTextDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR SentencePieceTextDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~SentencePieceTextDefaultTypeInternal() {}
+  union {
+    SentencePieceText _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SentencePieceTextDefaultTypeInternal _SentencePieceText_default_instance_;
+PROTOBUF_CONSTEXPR NBestSentencePieceText::NBestSentencePieceText(
+    ::_pbi::ConstantInitialized)
+  : nbests_(){}
+struct NBestSentencePieceTextDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR NBestSentencePieceTextDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~NBestSentencePieceTextDefaultTypeInternal() {}
+  union {
+    NBestSentencePieceText _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NBestSentencePieceTextDefaultTypeInternal _NBestSentencePieceText_default_instance_;
+}  // namespace sentencepiece
 namespace sentencepiece {
 
 // ===================================================================
@@ -92,27 +85,33 @@ class SentencePieceText_SentencePiece::_Internal {
   }
 };
 
-SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.SentencePieceText.SentencePiece)
 }
 SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(const SentencePieceText_SentencePiece& from)
   : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
       _has_bits_(from._has_bits_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
-  piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  piece_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    piece_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_piece()) {
-    piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_piece(), 
-      GetArena());
+    piece_.Set(from._internal_piece(), 
+      GetArenaForAllocation());
   }
-  surface_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  surface_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    surface_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_surface()) {
-    surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_surface(), 
-      GetArena());
+    surface_.Set(from._internal_surface(), 
+      GetArenaForAllocation());
   }
   ::memcpy(&id_, &from.id_,
     static_cast<size_t>(reinterpret_cast<char*>(&end_) -
@@ -120,46 +119,43 @@ SentencePieceText_SentencePiece::SentencePieceText_SentencePiece(const SentenceP
   // @@protoc_insertion_point(copy_constructor:sentencepiece.SentencePieceText.SentencePiece)
 }
 
-void SentencePieceText_SentencePiece::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto.base);
-  piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  surface_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
-      reinterpret_cast<char*>(&id_) - reinterpret_cast<char*>(this)),
-      0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
-      reinterpret_cast<char*>(&id_)) + sizeof(end_));
+inline void SentencePieceText_SentencePiece::SharedCtor() {
+piece_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  piece_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+surface_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  surface_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&id_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&end_) -
+    reinterpret_cast<char*>(&id_)) + sizeof(end_));
 }
 
 SentencePieceText_SentencePiece::~SentencePieceText_SentencePiece() {
   // @@protoc_insertion_point(destructor:sentencepiece.SentencePieceText.SentencePiece)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void SentencePieceText_SentencePiece::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
-  piece_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  surface_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SentencePieceText_SentencePiece::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  piece_.Destroy();
+  surface_.Destroy();
 }
 
-void SentencePieceText_SentencePiece::ArenaDtor(void* object) {
-  SentencePieceText_SentencePiece* _this = reinterpret_cast< SentencePieceText_SentencePiece* >(object);
-  (void)_this;
-}
-void SentencePieceText_SentencePiece::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void SentencePieceText_SentencePiece::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const SentencePieceText_SentencePiece& SentencePieceText_SentencePiece::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SentencePieceText_SentencePiece_sentencepiece_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void SentencePieceText_SentencePiece::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.SentencePieceText.SentencePiece)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -182,87 +178,91 @@ void SentencePieceText_SentencePiece::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* SentencePieceText_SentencePiece::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SentencePieceText_SentencePiece::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   _Internal::HasBits has_bits{};
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // optional string piece = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           auto str = _internal_mutable_piece();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional uint32 id = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
           _Internal::set_has_id(&has_bits);
           id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string surface = 3;
       case 3:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
           auto str = _internal_mutable_surface();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional uint32 begin = 4;
       case 4:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
           _Internal::set_has_begin(&has_bits);
           begin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional uint32 end = 5;
       case 5:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
           _Internal::set_has_end(&has_bits);
           end_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   _has_bits_.Or(has_bits);
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* SentencePieceText_SentencePiece::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SentencePieceText_SentencePiece::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SentencePieceText.SentencePiece)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
@@ -275,7 +275,7 @@ failure:
   // optional uint32 id = 2;
   if (cached_has_bits & 0x00000004u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_id(), target);
+    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_id(), target);
   }
 
   // optional string surface = 3;
@@ -287,18 +287,18 @@ failure:
   // optional uint32 begin = 4;
   if (cached_has_bits & 0x00000008u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(4, this->_internal_begin(), target);
+    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_begin(), target);
   }
 
   // optional uint32 end = 5;
   if (cached_has_bits & 0x00000010u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_end(), target);
+    target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_end(), target);
   }
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -314,7 +314,7 @@ size_t SentencePieceText_SentencePiece::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -336,46 +336,38 @@ size_t SentencePieceText_SentencePiece::ByteSizeLong() const {
 
     // optional uint32 id = 2;
     if (cached_has_bits & 0x00000004u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
-          this->_internal_id());
+      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id());
     }
 
     // optional uint32 begin = 4;
     if (cached_has_bits & 0x00000008u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
-          this->_internal_begin());
+      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_begin());
     }
 
     // optional uint32 end = 5;
     if (cached_has_bits & 0x00000010u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
-          this->_internal_end());
+      total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_end());
     }
 
   }
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void SentencePieceText_SentencePiece::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SentencePieceText_SentencePiece*>(
+  MergeFrom(*::_pbi::DownCast<const SentencePieceText_SentencePiece*>(
       &from));
 }
 
 void SentencePieceText_SentencePiece::MergeFrom(const SentencePieceText_SentencePiece& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SentencePieceText.SentencePiece)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
@@ -397,6 +389,8 @@ void SentencePieceText_SentencePiece::MergeFrom(const SentencePieceText_Sentence
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void SentencePieceText_SentencePiece::CopyFrom(const SentencePieceText_SentencePiece& from) {
@@ -416,11 +410,19 @@ bool SentencePieceText_SentencePiece::IsInitialized() const {
 
 void SentencePieceText_SentencePiece::InternalSwap(SentencePieceText_SentencePiece* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  piece_.Swap(&other->piece_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  surface_.Swap(&other->surface_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &piece_, lhs_arena,
+      &other->piece_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &surface_, lhs_arena,
+      &other->surface_, rhs_arena
+  );
   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
       PROTOBUF_FIELD_OFFSET(SentencePieceText_SentencePiece, end_)
       + sizeof(SentencePieceText_SentencePiece::end_)
@@ -447,12 +449,12 @@ class SentencePieceText::_Internal {
   }
 };
 
-SentencePieceText::SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+SentencePieceText::SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena),
   pieces_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.SentencePieceText)
 }
 SentencePieceText::SentencePieceText(const SentencePieceText& from)
@@ -460,51 +462,48 @@ SentencePieceText::SentencePieceText(const SentencePieceText& from)
       _has_bits_(from._has_bits_),
       pieces_(from.pieces_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
-  text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  text_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    text_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_text()) {
-    text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_text(), 
-      GetArena());
+    text_.Set(from._internal_text(), 
+      GetArenaForAllocation());
   }
   score_ = from.score_;
   // @@protoc_insertion_point(copy_constructor:sentencepiece.SentencePieceText)
 }
 
-void SentencePieceText::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SentencePieceText_sentencepiece_2eproto.base);
-  text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  score_ = 0;
+inline void SentencePieceText::SharedCtor() {
+text_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  text_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+score_ = 0;
 }
 
 SentencePieceText::~SentencePieceText() {
   // @@protoc_insertion_point(destructor:sentencepiece.SentencePieceText)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void SentencePieceText::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
-  text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SentencePieceText::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  text_.Destroy();
 }
 
-void SentencePieceText::ArenaDtor(void* object) {
-  SentencePieceText* _this = reinterpret_cast< SentencePieceText* >(object);
-  (void)_this;
-}
-void SentencePieceText::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void SentencePieceText::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const SentencePieceText& SentencePieceText::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SentencePieceText_sentencepiece_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void SentencePieceText::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.SentencePieceText)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -519,25 +518,25 @@ void SentencePieceText::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* SentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SentencePieceText::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   _Internal::HasBits has_bits{};
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // optional string text = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           auto str = _internal_mutable_text();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // repeated .sentencepiece.SentencePieceText.SentencePiece pieces = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
           ptr -= 1;
           do {
             ptr += 1;
@@ -545,49 +544,51 @@ const char* SentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_NAMESP
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional float score = 3;
       case 3:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 29)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
           _Internal::set_has_score(&has_bits);
           score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
           ptr += sizeof(float);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   _has_bits_.Or(has_bits);
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* SentencePieceText::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SentencePieceText::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SentencePieceText)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
@@ -598,22 +599,22 @@ failure:
   }
 
   // repeated .sentencepiece.SentencePieceText.SentencePiece pieces = 2;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->_internal_pieces_size()); i < n; i++) {
-    target = stream->EnsureSpace(target);
+  for (unsigned i = 0,
+      n = static_cast<unsigned>(this->_internal_pieces_size()); i < n; i++) {
+    const auto& repfield = this->_internal_pieces(i);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(2, this->_internal_pieces(i), target, stream);
+        InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
   }
 
   // optional float score = 3;
   if (cached_has_bits & 0x00000002u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_score(), target);
+    target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_score(), target);
   }
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -629,7 +630,7 @@ size_t SentencePieceText::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -658,23 +659,21 @@ size_t SentencePieceText::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void SentencePieceText::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SentencePieceText*>(
+  MergeFrom(*::_pbi::DownCast<const SentencePieceText*>(
       &from));
 }
 
 void SentencePieceText::MergeFrom(const SentencePieceText& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SentencePieceText)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   pieces_.MergeFrom(from.pieces_);
@@ -688,6 +687,8 @@ void SentencePieceText::MergeFrom(const SentencePieceText& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void SentencePieceText::CopyFrom(const SentencePieceText& from) {
@@ -702,17 +703,23 @@ bool SentencePieceText::IsInitialized() const {
     return false;
   }
 
-  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(pieces_)) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(pieces_))
+    return false;
   return true;
 }
 
 void SentencePieceText::InternalSwap(SentencePieceText* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   pieces_.InternalSwap(&other->pieces_);
-  text_.Swap(&other->text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &text_, lhs_arena,
+      &other->text_, rhs_arena
+  );
   swap(score_, other->score_);
 }
 
@@ -727,11 +734,11 @@ class NBestSentencePieceText::_Internal {
  public:
 };
 
-NBestSentencePieceText::NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+NBestSentencePieceText::NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   nbests_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.NBestSentencePieceText)
 }
 NBestSentencePieceText::NBestSentencePieceText(const NBestSentencePieceText& from)
@@ -741,38 +748,29 @@ NBestSentencePieceText::NBestSentencePieceText(const NBestSentencePieceText& fro
   // @@protoc_insertion_point(copy_constructor:sentencepiece.NBestSentencePieceText)
 }
 
-void NBestSentencePieceText::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NBestSentencePieceText_sentencepiece_2eproto.base);
+inline void NBestSentencePieceText::SharedCtor() {
 }
 
 NBestSentencePieceText::~NBestSentencePieceText() {
   // @@protoc_insertion_point(destructor:sentencepiece.NBestSentencePieceText)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void NBestSentencePieceText::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
+inline void NBestSentencePieceText::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void NBestSentencePieceText::ArenaDtor(void* object) {
-  NBestSentencePieceText* _this = reinterpret_cast< NBestSentencePieceText* >(object);
-  (void)_this;
-}
-void NBestSentencePieceText::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void NBestSentencePieceText::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const NBestSentencePieceText& NBestSentencePieceText::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NBestSentencePieceText_sentencepiece_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void NBestSentencePieceText::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.NBestSentencePieceText)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -780,16 +778,15 @@ void NBestSentencePieceText::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* NBestSentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* NBestSentencePieceText::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // repeated .sentencepiece.SentencePieceText nbests = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           ptr -= 1;
           do {
             ptr += 1;
@@ -797,42 +794,44 @@ const char* NBestSentencePieceText::_InternalParse(const char* ptr, ::PROTOBUF_N
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* NBestSentencePieceText::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* NBestSentencePieceText::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.NBestSentencePieceText)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .sentencepiece.SentencePieceText nbests = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->_internal_nbests_size()); i < n; i++) {
-    target = stream->EnsureSpace(target);
+  for (unsigned i = 0,
+      n = static_cast<unsigned>(this->_internal_nbests_size()); i < n; i++) {
+    const auto& repfield = this->_internal_nbests(i);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(1, this->_internal_nbests(i), target, stream);
+        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
   }
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
@@ -847,7 +846,7 @@ size_t NBestSentencePieceText::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:sentencepiece.NBestSentencePieceText)
   size_t total_size = 0;
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -861,25 +860,25 @@ size_t NBestSentencePieceText::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void NBestSentencePieceText::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const NBestSentencePieceText*>(
+  MergeFrom(*::_pbi::DownCast<const NBestSentencePieceText*>(
       &from));
 }
 
 void NBestSentencePieceText::MergeFrom(const NBestSentencePieceText& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.NBestSentencePieceText)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   nbests_.MergeFrom(from.nbests_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void NBestSentencePieceText::CopyFrom(const NBestSentencePieceText& from) {
@@ -890,13 +889,14 @@ void NBestSentencePieceText::CopyFrom(const NBestSentencePieceText& from) {
 }
 
 bool NBestSentencePieceText::IsInitialized() const {
-  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(nbests_)) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(nbests_))
+    return false;
   return true;
 }
 
 void NBestSentencePieceText::InternalSwap(NBestSentencePieceText* other) {
   using std::swap;
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   nbests_.InternalSwap(&other->nbests_);
 }
 
@@ -908,13 +908,16 @@ std::string NBestSentencePieceText::GetTypeName() const {
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace sentencepiece
 PROTOBUF_NAMESPACE_OPEN
-template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText_SentencePiece* Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText_SentencePiece >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText_SentencePiece*
+Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText_SentencePiece >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::SentencePieceText_SentencePiece >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText* Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SentencePieceText*
+Arena::CreateMaybeMessage< ::sentencepiece::SentencePieceText >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::SentencePieceText >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::NBestSentencePieceText* Arena::CreateMaybeMessage< ::sentencepiece::NBestSentencePieceText >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::NBestSentencePieceText*
+Arena::CreateMaybeMessage< ::sentencepiece::NBestSentencePieceText >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::NBestSentencePieceText >(arena);
 }
 PROTOBUF_NAMESPACE_CLOSE
diff --git a/src/builtin_pb/sentencepiece.pb.h b/src/builtin_pb/sentencepiece.pb.h
index 24ec337..ecd81ed 100644
--- a/src/builtin_pb/sentencepiece.pb.h
+++ b/src/builtin_pb/sentencepiece.pb.h
@@ -8,12 +8,12 @@
 #include <string>
 
 #include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3014000
+#if PROTOBUF_VERSION < 3020000
 #error This file was generated by a newer version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3014000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3020002 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
@@ -23,7 +23,6 @@
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/metadata_lite.h>
 #include <google/protobuf/message_lite.h>
@@ -40,25 +39,17 @@ PROTOBUF_NAMESPACE_CLOSE
 
 // Internal implementation detail -- do not use these members.
 struct TableStruct_sentencepiece_2eproto {
-  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
-    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
-    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3]
-    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
-  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
-  static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
+  static const uint32_t offsets[];
 };
 namespace sentencepiece {
 class NBestSentencePieceText;
-class NBestSentencePieceTextDefaultTypeInternal;
+struct NBestSentencePieceTextDefaultTypeInternal;
 extern NBestSentencePieceTextDefaultTypeInternal _NBestSentencePieceText_default_instance_;
 class SentencePieceText;
-class SentencePieceTextDefaultTypeInternal;
+struct SentencePieceTextDefaultTypeInternal;
 extern SentencePieceTextDefaultTypeInternal _SentencePieceText_default_instance_;
 class SentencePieceText_SentencePiece;
-class SentencePieceText_SentencePieceDefaultTypeInternal;
+struct SentencePieceText_SentencePieceDefaultTypeInternal;
 extern SentencePieceText_SentencePieceDefaultTypeInternal _SentencePieceText_SentencePiece_default_instance_;
 }  // namespace sentencepiece
 PROTOBUF_NAMESPACE_OPEN
@@ -70,11 +61,12 @@ namespace sentencepiece {
 
 // ===================================================================
 
-class SentencePieceText_SentencePiece PROTOBUF_FINAL :
+class SentencePieceText_SentencePiece final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SentencePieceText.SentencePiece) */ {
  public:
   inline SentencePieceText_SentencePiece() : SentencePieceText_SentencePiece(nullptr) {}
-  virtual ~SentencePieceText_SentencePiece();
+  ~SentencePieceText_SentencePiece() override;
+  explicit PROTOBUF_CONSTEXPR SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SentencePieceText_SentencePiece(const SentencePieceText_SentencePiece& from);
   SentencePieceText_SentencePiece(SentencePieceText_SentencePiece&& from) noexcept
@@ -87,8 +79,13 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
     return *this;
   }
   inline SentencePieceText_SentencePiece& operator=(SentencePieceText_SentencePiece&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -102,8 +99,9 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const SentencePieceText_SentencePiece& default_instance();
-
+  static const SentencePieceText_SentencePiece& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SentencePieceText_SentencePiece* internal_default_instance() {
     return reinterpret_cast<const SentencePieceText_SentencePiece*>(
                &_SentencePieceText_SentencePiece_default_instance_);
@@ -116,7 +114,12 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   }
   inline void Swap(SentencePieceText_SentencePiece* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -124,21 +127,16 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(SentencePieceText_SentencePiece* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline SentencePieceText_SentencePiece* New() const final {
-    return CreateMaybeMessage<SentencePieceText_SentencePiece>(nullptr);
-  }
-
-  SentencePieceText_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  SentencePieceText_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<SentencePieceText_SentencePiece>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const SentencePieceText_SentencePiece& from);
   void MergeFrom(const SentencePieceText_SentencePiece& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -146,25 +144,24 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(SentencePieceText_SentencePiece* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.SentencePieceText.SentencePiece";
   }
   protected:
-  explicit SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit SentencePieceText_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -187,16 +184,14 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   public:
   void clear_piece();
   const std::string& piece() const;
-  void set_piece(const std::string& value);
-  void set_piece(std::string&& value);
-  void set_piece(const char* value);
-  void set_piece(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_piece(ArgT0&& arg0, ArgT... args);
   std::string* mutable_piece();
-  std::string* release_piece();
+  PROTOBUF_NODISCARD std::string* release_piece();
   void set_allocated_piece(std::string* piece);
   private:
   const std::string& _internal_piece() const;
-  void _internal_set_piece(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_piece(const std::string& value);
   std::string* _internal_mutable_piece();
   public:
 
@@ -207,16 +202,14 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   public:
   void clear_surface();
   const std::string& surface() const;
-  void set_surface(const std::string& value);
-  void set_surface(std::string&& value);
-  void set_surface(const char* value);
-  void set_surface(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_surface(ArgT0&& arg0, ArgT... args);
   std::string* mutable_surface();
-  std::string* release_surface();
+  PROTOBUF_NODISCARD std::string* release_surface();
   void set_allocated_surface(std::string* surface);
   private:
   const std::string& _internal_surface() const;
-  void _internal_set_surface(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_surface(const std::string& value);
   std::string* _internal_mutable_surface();
   public:
 
@@ -226,11 +219,11 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   bool _internal_has_id() const;
   public:
   void clear_id();
-  ::PROTOBUF_NAMESPACE_ID::uint32 id() const;
-  void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value);
+  uint32_t id() const;
+  void set_id(uint32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const;
-  void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value);
+  uint32_t _internal_id() const;
+  void _internal_set_id(uint32_t value);
   public:
 
   // optional uint32 begin = 4;
@@ -239,11 +232,11 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   bool _internal_has_begin() const;
   public:
   void clear_begin();
-  ::PROTOBUF_NAMESPACE_ID::uint32 begin() const;
-  void set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value);
+  uint32_t begin() const;
+  void set_begin(uint32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::uint32 _internal_begin() const;
-  void _internal_set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value);
+  uint32_t _internal_begin() const;
+  void _internal_set_begin(uint32_t value);
   public:
 
   // optional uint32 end = 5;
@@ -252,14 +245,203 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   bool _internal_has_end() const;
   public:
   void clear_end();
-  ::PROTOBUF_NAMESPACE_ID::uint32 end() const;
-  void set_end(::PROTOBUF_NAMESPACE_ID::uint32 value);
+  uint32_t end() const;
+  void set_end(uint32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::uint32 _internal_end() const;
-  void _internal_set_end(::PROTOBUF_NAMESPACE_ID::uint32 value);
+  uint32_t _internal_end() const;
+  void _internal_set_end(uint32_t value);
   public:
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(SentencePieceText_SentencePiece)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.SentencePieceText.SentencePiece)
  private:
   class _Internal;
@@ -273,18 +455,19 @@ class SentencePieceText_SentencePiece PROTOBUF_FINAL :
   mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr piece_;
   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr surface_;
-  ::PROTOBUF_NAMESPACE_ID::uint32 id_;
-  ::PROTOBUF_NAMESPACE_ID::uint32 begin_;
-  ::PROTOBUF_NAMESPACE_ID::uint32 end_;
+  uint32_t id_;
+  uint32_t begin_;
+  uint32_t end_;
   friend struct ::TableStruct_sentencepiece_2eproto;
 };
 // -------------------------------------------------------------------
 
-class SentencePieceText PROTOBUF_FINAL :
+class SentencePieceText final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SentencePieceText) */ {
  public:
   inline SentencePieceText() : SentencePieceText(nullptr) {}
-  virtual ~SentencePieceText();
+  ~SentencePieceText() override;
+  explicit PROTOBUF_CONSTEXPR SentencePieceText(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SentencePieceText(const SentencePieceText& from);
   SentencePieceText(SentencePieceText&& from) noexcept
@@ -297,8 +480,13 @@ class SentencePieceText PROTOBUF_FINAL :
     return *this;
   }
   inline SentencePieceText& operator=(SentencePieceText&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -312,8 +500,9 @@ class SentencePieceText PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const SentencePieceText& default_instance();
-
+  static const SentencePieceText& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SentencePieceText* internal_default_instance() {
     return reinterpret_cast<const SentencePieceText*>(
                &_SentencePieceText_default_instance_);
@@ -326,7 +515,12 @@ class SentencePieceText PROTOBUF_FINAL :
   }
   inline void Swap(SentencePieceText* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -334,21 +528,16 @@ class SentencePieceText PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(SentencePieceText* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline SentencePieceText* New() const final {
-    return CreateMaybeMessage<SentencePieceText>(nullptr);
-  }
-
-  SentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  SentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<SentencePieceText>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const SentencePieceText& from);
   void MergeFrom(const SentencePieceText& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -356,25 +545,24 @@ class SentencePieceText PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(SentencePieceText* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.SentencePieceText";
   }
   protected:
-  explicit SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit SentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -415,16 +603,14 @@ class SentencePieceText PROTOBUF_FINAL :
   public:
   void clear_text();
   const std::string& text() const;
-  void set_text(const std::string& value);
-  void set_text(std::string&& value);
-  void set_text(const char* value);
-  void set_text(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_text(ArgT0&& arg0, ArgT... args);
   std::string* mutable_text();
-  std::string* release_text();
+  PROTOBUF_NODISCARD std::string* release_text();
   void set_allocated_text(std::string* text);
   private:
   const std::string& _internal_text() const;
-  void _internal_set_text(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_text(const std::string& value);
   std::string* _internal_mutable_text();
   public:
 
@@ -441,7 +627,196 @@ class SentencePieceText PROTOBUF_FINAL :
   void _internal_set_score(float value);
   public:
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(SentencePieceText)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SentencePieceText, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.SentencePieceText)
  private:
   class _Internal;
@@ -460,11 +835,12 @@ class SentencePieceText PROTOBUF_FINAL :
 };
 // -------------------------------------------------------------------
 
-class NBestSentencePieceText PROTOBUF_FINAL :
+class NBestSentencePieceText final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.NBestSentencePieceText) */ {
  public:
   inline NBestSentencePieceText() : NBestSentencePieceText(nullptr) {}
-  virtual ~NBestSentencePieceText();
+  ~NBestSentencePieceText() override;
+  explicit PROTOBUF_CONSTEXPR NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NBestSentencePieceText(const NBestSentencePieceText& from);
   NBestSentencePieceText(NBestSentencePieceText&& from) noexcept
@@ -477,8 +853,13 @@ class NBestSentencePieceText PROTOBUF_FINAL :
     return *this;
   }
   inline NBestSentencePieceText& operator=(NBestSentencePieceText&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -492,8 +873,9 @@ class NBestSentencePieceText PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const NBestSentencePieceText& default_instance();
-
+  static const NBestSentencePieceText& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NBestSentencePieceText* internal_default_instance() {
     return reinterpret_cast<const NBestSentencePieceText*>(
                &_NBestSentencePieceText_default_instance_);
@@ -506,7 +888,12 @@ class NBestSentencePieceText PROTOBUF_FINAL :
   }
   inline void Swap(NBestSentencePieceText* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -514,21 +901,16 @@ class NBestSentencePieceText PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(NBestSentencePieceText* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline NBestSentencePieceText* New() const final {
-    return CreateMaybeMessage<NBestSentencePieceText>(nullptr);
-  }
-
-  NBestSentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  NBestSentencePieceText* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<NBestSentencePieceText>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const NBestSentencePieceText& from);
   void MergeFrom(const NBestSentencePieceText& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -536,25 +918,24 @@ class NBestSentencePieceText PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(NBestSentencePieceText* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.NBestSentencePieceText";
   }
   protected:
-  explicit NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit NBestSentencePieceText(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -622,43 +1003,28 @@ inline const std::string& SentencePieceText_SentencePiece::piece() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.piece)
   return _internal_piece();
 }
-inline void SentencePieceText_SentencePiece::set_piece(const std::string& value) {
-  _internal_set_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SentencePieceText_SentencePiece::set_piece(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.piece)
 }
 inline std::string* SentencePieceText_SentencePiece::mutable_piece() {
+  std::string* _s = _internal_mutable_piece();
   // @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.SentencePiece.piece)
-  return _internal_mutable_piece();
+  return _s;
 }
 inline const std::string& SentencePieceText_SentencePiece::_internal_piece() const {
   return piece_.Get();
 }
 inline void SentencePieceText_SentencePiece::_internal_set_piece(const std::string& value) {
   _has_bits_[0] |= 0x00000001u;
-  piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SentencePieceText_SentencePiece::set_piece(std::string&& value) {
-  _has_bits_[0] |= 0x00000001u;
-  piece_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SentencePieceText.SentencePiece.piece)
-}
-inline void SentencePieceText_SentencePiece::set_piece(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000001u;
-  piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.SentencePieceText.SentencePiece.piece)
-}
-inline void SentencePieceText_SentencePiece::set_piece(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000001u;
-  piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.SentencePieceText.SentencePiece.piece)
+  piece_.Set(value, GetArenaForAllocation());
 }
 inline std::string* SentencePieceText_SentencePiece::_internal_mutable_piece() {
   _has_bits_[0] |= 0x00000001u;
-  return piece_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return piece_.Mutable(GetArenaForAllocation());
 }
 inline std::string* SentencePieceText_SentencePiece::release_piece() {
   // @@protoc_insertion_point(field_release:sentencepiece.SentencePieceText.SentencePiece.piece)
@@ -666,7 +1032,13 @@ inline std::string* SentencePieceText_SentencePiece::release_piece() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000001u;
-  return piece_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = piece_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (piece_.IsDefault()) {
+    piece_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void SentencePieceText_SentencePiece::set_allocated_piece(std::string* piece) {
   if (piece != nullptr) {
@@ -674,8 +1046,12 @@ inline void SentencePieceText_SentencePiece::set_allocated_piece(std::string* pi
   } else {
     _has_bits_[0] &= ~0x00000001u;
   }
-  piece_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), piece,
-      GetArena());
+  piece_.SetAllocated(piece, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (piece_.IsDefault()) {
+    piece_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.SentencePieceText.SentencePiece.piece)
 }
 
@@ -691,18 +1067,18 @@ inline void SentencePieceText_SentencePiece::clear_id() {
   id_ = 0u;
   _has_bits_[0] &= ~0x00000004u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::_internal_id() const {
+inline uint32_t SentencePieceText_SentencePiece::_internal_id() const {
   return id_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::id() const {
+inline uint32_t SentencePieceText_SentencePiece::id() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.id)
   return _internal_id();
 }
-inline void SentencePieceText_SentencePiece::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::_internal_set_id(uint32_t value) {
   _has_bits_[0] |= 0x00000004u;
   id_ = value;
 }
-inline void SentencePieceText_SentencePiece::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::set_id(uint32_t value) {
   _internal_set_id(value);
   // @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.id)
 }
@@ -723,43 +1099,28 @@ inline const std::string& SentencePieceText_SentencePiece::surface() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.surface)
   return _internal_surface();
 }
-inline void SentencePieceText_SentencePiece::set_surface(const std::string& value) {
-  _internal_set_surface(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SentencePieceText_SentencePiece::set_surface(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ surface_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.surface)
 }
 inline std::string* SentencePieceText_SentencePiece::mutable_surface() {
+  std::string* _s = _internal_mutable_surface();
   // @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.SentencePiece.surface)
-  return _internal_mutable_surface();
+  return _s;
 }
 inline const std::string& SentencePieceText_SentencePiece::_internal_surface() const {
   return surface_.Get();
 }
 inline void SentencePieceText_SentencePiece::_internal_set_surface(const std::string& value) {
   _has_bits_[0] |= 0x00000002u;
-  surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SentencePieceText_SentencePiece::set_surface(std::string&& value) {
-  _has_bits_[0] |= 0x00000002u;
-  surface_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SentencePieceText.SentencePiece.surface)
-}
-inline void SentencePieceText_SentencePiece::set_surface(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000002u;
-  surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.SentencePieceText.SentencePiece.surface)
-}
-inline void SentencePieceText_SentencePiece::set_surface(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000002u;
-  surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.SentencePieceText.SentencePiece.surface)
+  surface_.Set(value, GetArenaForAllocation());
 }
 inline std::string* SentencePieceText_SentencePiece::_internal_mutable_surface() {
   _has_bits_[0] |= 0x00000002u;
-  return surface_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return surface_.Mutable(GetArenaForAllocation());
 }
 inline std::string* SentencePieceText_SentencePiece::release_surface() {
   // @@protoc_insertion_point(field_release:sentencepiece.SentencePieceText.SentencePiece.surface)
@@ -767,7 +1128,13 @@ inline std::string* SentencePieceText_SentencePiece::release_surface() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000002u;
-  return surface_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = surface_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (surface_.IsDefault()) {
+    surface_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void SentencePieceText_SentencePiece::set_allocated_surface(std::string* surface) {
   if (surface != nullptr) {
@@ -775,8 +1142,12 @@ inline void SentencePieceText_SentencePiece::set_allocated_surface(std::string*
   } else {
     _has_bits_[0] &= ~0x00000002u;
   }
-  surface_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), surface,
-      GetArena());
+  surface_.SetAllocated(surface, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (surface_.IsDefault()) {
+    surface_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.SentencePieceText.SentencePiece.surface)
 }
 
@@ -792,18 +1163,18 @@ inline void SentencePieceText_SentencePiece::clear_begin() {
   begin_ = 0u;
   _has_bits_[0] &= ~0x00000008u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::_internal_begin() const {
+inline uint32_t SentencePieceText_SentencePiece::_internal_begin() const {
   return begin_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::begin() const {
+inline uint32_t SentencePieceText_SentencePiece::begin() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.begin)
   return _internal_begin();
 }
-inline void SentencePieceText_SentencePiece::_internal_set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::_internal_set_begin(uint32_t value) {
   _has_bits_[0] |= 0x00000008u;
   begin_ = value;
 }
-inline void SentencePieceText_SentencePiece::set_begin(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::set_begin(uint32_t value) {
   _internal_set_begin(value);
   // @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.begin)
 }
@@ -820,18 +1191,18 @@ inline void SentencePieceText_SentencePiece::clear_end() {
   end_ = 0u;
   _has_bits_[0] &= ~0x00000010u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::_internal_end() const {
+inline uint32_t SentencePieceText_SentencePiece::_internal_end() const {
   return end_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint32 SentencePieceText_SentencePiece::end() const {
+inline uint32_t SentencePieceText_SentencePiece::end() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.SentencePiece.end)
   return _internal_end();
 }
-inline void SentencePieceText_SentencePiece::_internal_set_end(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::_internal_set_end(uint32_t value) {
   _has_bits_[0] |= 0x00000010u;
   end_ = value;
 }
-inline void SentencePieceText_SentencePiece::set_end(::PROTOBUF_NAMESPACE_ID::uint32 value) {
+inline void SentencePieceText_SentencePiece::set_end(uint32_t value) {
   _internal_set_end(value);
   // @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.SentencePiece.end)
 }
@@ -856,43 +1227,28 @@ inline const std::string& SentencePieceText::text() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SentencePieceText.text)
   return _internal_text();
 }
-inline void SentencePieceText::set_text(const std::string& value) {
-  _internal_set_text(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SentencePieceText::set_text(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ text_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.SentencePieceText.text)
 }
 inline std::string* SentencePieceText::mutable_text() {
+  std::string* _s = _internal_mutable_text();
   // @@protoc_insertion_point(field_mutable:sentencepiece.SentencePieceText.text)
-  return _internal_mutable_text();
+  return _s;
 }
 inline const std::string& SentencePieceText::_internal_text() const {
   return text_.Get();
 }
 inline void SentencePieceText::_internal_set_text(const std::string& value) {
   _has_bits_[0] |= 0x00000001u;
-  text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SentencePieceText::set_text(std::string&& value) {
-  _has_bits_[0] |= 0x00000001u;
-  text_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SentencePieceText.text)
-}
-inline void SentencePieceText::set_text(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000001u;
-  text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.SentencePieceText.text)
-}
-inline void SentencePieceText::set_text(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000001u;
-  text_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.SentencePieceText.text)
+  text_.Set(value, GetArenaForAllocation());
 }
 inline std::string* SentencePieceText::_internal_mutable_text() {
   _has_bits_[0] |= 0x00000001u;
-  return text_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return text_.Mutable(GetArenaForAllocation());
 }
 inline std::string* SentencePieceText::release_text() {
   // @@protoc_insertion_point(field_release:sentencepiece.SentencePieceText.text)
@@ -900,7 +1256,13 @@ inline std::string* SentencePieceText::release_text() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000001u;
-  return text_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = text_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (text_.IsDefault()) {
+    text_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void SentencePieceText::set_allocated_text(std::string* text) {
   if (text != nullptr) {
@@ -908,8 +1270,12 @@ inline void SentencePieceText::set_allocated_text(std::string* text) {
   } else {
     _has_bits_[0] &= ~0x00000001u;
   }
-  text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), text,
-      GetArena());
+  text_.SetAllocated(text, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (text_.IsDefault()) {
+    text_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.SentencePieceText.text)
 }
 
@@ -943,8 +1309,9 @@ inline ::sentencepiece::SentencePieceText_SentencePiece* SentencePieceText::_int
   return pieces_.Add();
 }
 inline ::sentencepiece::SentencePieceText_SentencePiece* SentencePieceText::add_pieces() {
+  ::sentencepiece::SentencePieceText_SentencePiece* _add = _internal_add_pieces();
   // @@protoc_insertion_point(field_add:sentencepiece.SentencePieceText.pieces)
-  return _internal_add_pieces();
+  return _add;
 }
 inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText_SentencePiece >&
 SentencePieceText::pieces() const {
@@ -1014,8 +1381,9 @@ inline ::sentencepiece::SentencePieceText* NBestSentencePieceText::_internal_add
   return nbests_.Add();
 }
 inline ::sentencepiece::SentencePieceText* NBestSentencePieceText::add_nbests() {
+  ::sentencepiece::SentencePieceText* _add = _internal_add_nbests();
   // @@protoc_insertion_point(field_add:sentencepiece.NBestSentencePieceText.nbests)
-  return _internal_add_nbests();
+  return _add;
 }
 inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SentencePieceText >&
 NBestSentencePieceText::nbests() const {
diff --git a/src/builtin_pb/sentencepiece_model.pb.cc b/src/builtin_pb/sentencepiece_model.pb.cc
index e913731..58d19e6 100644
--- a/src/builtin_pb/sentencepiece_model.pb.cc
+++ b/src/builtin_pb/sentencepiece_model.pb.cc
@@ -11,120 +11,140 @@
 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 // @@protoc_insertion_point(includes)
 #include <google/protobuf/port_def.inc>
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SelfTestData_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto;
-extern PROTOBUF_INTERNAL_EXPORT_sentencepiece_5fmodel_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto;
-namespace sentencepiece {
-class TrainerSpecDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<TrainerSpec> _instance;
-} _TrainerSpec_default_instance_;
-class NormalizerSpecDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NormalizerSpec> _instance;
-} _NormalizerSpec_default_instance_;
-class SelfTestData_SampleDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SelfTestData_Sample> _instance;
-} _SelfTestData_Sample_default_instance_;
-class SelfTestDataDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<SelfTestData> _instance;
-} _SelfTestData_default_instance_;
-class ModelProto_SentencePieceDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ModelProto_SentencePiece> _instance;
-} _ModelProto_SentencePiece_default_instance_;
-class ModelProtoDefaultTypeInternal {
- public:
-  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ModelProto> _instance;
-} _ModelProto_default_instance_;
-}  // namespace sentencepiece
-static void InitDefaultsscc_info_ModelProto_sentencepiece_5fmodel_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_ModelProto_default_instance_;
-    new (ptr) ::sentencepiece::ModelProto();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_ModelProto_sentencepiece_5fmodel_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, 0, InitDefaultsscc_info_ModelProto_sentencepiece_5fmodel_2eproto}, {
-      &scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto.base,
-      &scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto.base,
-      &scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto.base,
-      &scc_info_SelfTestData_sentencepiece_5fmodel_2eproto.base,}};
-
-static void InitDefaultsscc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_ModelProto_SentencePiece_default_instance_;
-    new (ptr) ::sentencepiece::ModelProto_SentencePiece();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto}, {}};
-
-static void InitDefaultsscc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_NormalizerSpec_default_instance_;
-    new (ptr) ::sentencepiece::NormalizerSpec();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
 
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto}, {}};
+PROTOBUF_PRAGMA_INIT_SEG
 
-static void InitDefaultsscc_info_SelfTestData_sentencepiece_5fmodel_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_SelfTestData_default_instance_;
-    new (ptr) ::sentencepiece::SelfTestData();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_SelfTestData_sentencepiece_5fmodel_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_SelfTestData_sentencepiece_5fmodel_2eproto}, {
-      &scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto.base,}};
-
-static void InitDefaultsscc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_SelfTestData_Sample_default_instance_;
-    new (ptr) ::sentencepiece::SelfTestData_Sample();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto}, {}};
-
-static void InitDefaultsscc_info_TrainerSpec_sentencepiece_5fmodel_2eproto() {
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
-
-  {
-    void* ptr = &::sentencepiece::_TrainerSpec_default_instance_;
-    new (ptr) ::sentencepiece::TrainerSpec();
-    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
-  }
-}
-
-::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto =
-    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_TrainerSpec_sentencepiece_5fmodel_2eproto}, {}};
+namespace _pb = ::PROTOBUF_NAMESPACE_ID;
+namespace _pbi = _pb::internal;
 
+namespace sentencepiece {
+PROTOBUF_CONSTEXPR TrainerSpec::TrainerSpec(
+    ::_pbi::ConstantInitialized)
+  : input_()
+  , accept_language_()
+  , control_symbols_()
+  , user_defined_symbols_()
+  , model_prefix_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , input_format_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , required_chars_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , unk_surface_(nullptr, ::_pbi::ConstantInitialized{})
+  , unk_piece_(nullptr, ::_pbi::ConstantInitialized{})
+  , bos_piece_(nullptr, ::_pbi::ConstantInitialized{})
+  , eos_piece_(nullptr, ::_pbi::ConstantInitialized{})
+  , pad_piece_(nullptr, ::_pbi::ConstantInitialized{})
+  , self_test_sample_size_(0)
+  , mining_sentence_size_(0)
+  , input_sentence_size_(uint64_t{0u})
+  , training_sentence_size_(0)
+  , treat_whitespace_as_suffix_(false)
+  , allow_whitespace_only_pieces_(false)
+  , split_digits_(false)
+  , byte_fallback_(false)
+  , unk_id_(0)
+  , use_all_vocab_(false)
+  , train_extremely_large_corpus_(false)
+  , model_type_(1)
+
+  , vocab_size_(8000)
+  , character_coverage_(0.9995f)
+  , seed_sentencepiece_size_(1000000)
+  , shrinking_factor_(0.75f)
+  , num_threads_(16)
+  , num_sub_iterations_(2)
+  , max_sentence_length_(4192)
+  , max_sentencepiece_length_(16)
+  , shuffle_input_sentence_(true)
+  , split_by_unicode_script_(true)
+  , split_by_number_(true)
+  , split_by_whitespace_(true)
+  , vocabulary_output_piece_score_(true)
+  , hard_vocab_limit_(true)
+  , bos_id_(1)
+  , eos_id_(2)
+  , pad_id_(-1){}
+struct TrainerSpecDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR TrainerSpecDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~TrainerSpecDefaultTypeInternal() {}
+  union {
+    TrainerSpec _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrainerSpecDefaultTypeInternal _TrainerSpec_default_instance_;
+PROTOBUF_CONSTEXPR NormalizerSpec::NormalizerSpec(
+    ::_pbi::ConstantInitialized)
+  : name_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , precompiled_charsmap_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , normalization_rule_tsv_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , add_dummy_prefix_(true)
+  , remove_extra_whitespaces_(true)
+  , escape_whitespaces_(true){}
+struct NormalizerSpecDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR NormalizerSpecDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~NormalizerSpecDefaultTypeInternal() {}
+  union {
+    NormalizerSpec _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 NormalizerSpecDefaultTypeInternal _NormalizerSpec_default_instance_;
+PROTOBUF_CONSTEXPR SelfTestData_Sample::SelfTestData_Sample(
+    ::_pbi::ConstantInitialized)
+  : input_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , expected_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}){}
+struct SelfTestData_SampleDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR SelfTestData_SampleDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~SelfTestData_SampleDefaultTypeInternal() {}
+  union {
+    SelfTestData_Sample _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SelfTestData_SampleDefaultTypeInternal _SelfTestData_Sample_default_instance_;
+PROTOBUF_CONSTEXPR SelfTestData::SelfTestData(
+    ::_pbi::ConstantInitialized)
+  : samples_(){}
+struct SelfTestDataDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR SelfTestDataDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~SelfTestDataDefaultTypeInternal() {}
+  union {
+    SelfTestData _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SelfTestDataDefaultTypeInternal _SelfTestData_default_instance_;
+PROTOBUF_CONSTEXPR ModelProto_SentencePiece::ModelProto_SentencePiece(
+    ::_pbi::ConstantInitialized)
+  : piece_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
+  , score_(0)
+  , type_(1)
+{}
+struct ModelProto_SentencePieceDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR ModelProto_SentencePieceDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~ModelProto_SentencePieceDefaultTypeInternal() {}
+  union {
+    ModelProto_SentencePiece _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ModelProto_SentencePieceDefaultTypeInternal _ModelProto_SentencePiece_default_instance_;
+PROTOBUF_CONSTEXPR ModelProto::ModelProto(
+    ::_pbi::ConstantInitialized)
+  : pieces_()
+  , trainer_spec_(nullptr)
+  , normalizer_spec_(nullptr)
+  , self_test_data_(nullptr)
+  , denormalizer_spec_(nullptr){}
+struct ModelProtoDefaultTypeInternal {
+  PROTOBUF_CONSTEXPR ModelProtoDefaultTypeInternal()
+      : _instance(::_pbi::ConstantInitialized{}) {}
+  ~ModelProtoDefaultTypeInternal() {}
+  union {
+    ModelProto _instance;
+  };
+};
+PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ModelProtoDefaultTypeInternal _ModelProto_default_instance_;
+}  // namespace sentencepiece
 namespace sentencepiece {
 bool TrainerSpec_ModelType_IsValid(int value) {
   switch (value) {
@@ -185,7 +205,7 @@ bool TrainerSpec_ModelType_Parse(
   }
   return success;
 }
-#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
 constexpr TrainerSpec_ModelType TrainerSpec::UNIGRAM;
 constexpr TrainerSpec_ModelType TrainerSpec::BPE;
 constexpr TrainerSpec_ModelType TrainerSpec::WORD;
@@ -193,7 +213,7 @@ constexpr TrainerSpec_ModelType TrainerSpec::CHAR;
 constexpr TrainerSpec_ModelType TrainerSpec::ModelType_MIN;
 constexpr TrainerSpec_ModelType TrainerSpec::ModelType_MAX;
 constexpr int TrainerSpec::ModelType_ARRAYSIZE;
-#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
 bool ModelProto_SentencePiece_Type_IsValid(int value) {
   switch (value) {
     case 1:
@@ -261,7 +281,7 @@ bool ModelProto_SentencePiece_Type_Parse(
   }
   return success;
 }
-#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
 constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::NORMAL;
 constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::UNKNOWN;
 constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::CONTROL;
@@ -271,7 +291,7 @@ constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::UNUSED;
 constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::Type_MIN;
 constexpr ModelProto_SentencePiece_Type ModelProto_SentencePiece::Type_MAX;
 constexpr int ModelProto_SentencePiece::Type_ARRAYSIZE;
-#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
+#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
 
 // ===================================================================
 
@@ -396,15 +416,15 @@ const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permiss
 const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_{{{"</s>", 4}}, {nullptr}};
 const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_{{{"<pad>", 5}}, {nullptr}};
 const ::PROTOBUF_NAMESPACE_ID::internal::LazyString TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_{{{" \342\201\207 ", 5}}, {nullptr}};
-TrainerSpec::TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+TrainerSpec::TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena),
   input_(arena),
   accept_language_(arena),
   control_symbols_(arena),
   user_defined_symbols_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.TrainerSpec)
 }
 TrainerSpec::TrainerSpec(const TrainerSpec& from)
@@ -415,46 +435,55 @@ TrainerSpec::TrainerSpec(const TrainerSpec& from)
       control_symbols_(from.control_symbols_),
       user_defined_symbols_(from.user_defined_symbols_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
-  model_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  model_prefix_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    model_prefix_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_model_prefix()) {
-    model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_model_prefix(), 
-      GetArena());
+    model_prefix_.Set(from._internal_model_prefix(), 
+      GetArenaForAllocation());
   }
-  input_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  input_format_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    input_format_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_input_format()) {
-    input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_input_format(), 
-      GetArena());
+    input_format_.Set(from._internal_input_format(), 
+      GetArenaForAllocation());
   }
-  required_chars_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  required_chars_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    required_chars_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_required_chars()) {
-    required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_required_chars(), 
-      GetArena());
+    required_chars_.Set(from._internal_required_chars(), 
+      GetArenaForAllocation());
   }
-  unk_surface_.UnsafeSetDefault(nullptr);
+  unk_surface_.InitDefault();
   if (from._internal_has_unk_surface()) {
-    unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_unk_surface(), 
-      GetArena());
+    unk_surface_.Set(from._internal_unk_surface(), 
+      GetArenaForAllocation());
   }
-  unk_piece_.UnsafeSetDefault(nullptr);
+  unk_piece_.InitDefault();
   if (from._internal_has_unk_piece()) {
-    unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_unk_piece(), 
-      GetArena());
+    unk_piece_.Set(from._internal_unk_piece(), 
+      GetArenaForAllocation());
   }
-  bos_piece_.UnsafeSetDefault(nullptr);
+  bos_piece_.InitDefault();
   if (from._internal_has_bos_piece()) {
-    bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_bos_piece(), 
-      GetArena());
+    bos_piece_.Set(from._internal_bos_piece(), 
+      GetArenaForAllocation());
   }
-  eos_piece_.UnsafeSetDefault(nullptr);
+  eos_piece_.InitDefault();
   if (from._internal_has_eos_piece()) {
-    eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_eos_piece(), 
-      GetArena());
+    eos_piece_.Set(from._internal_eos_piece(), 
+      GetArenaForAllocation());
   }
-  pad_piece_.UnsafeSetDefault(nullptr);
+  pad_piece_.InitDefault();
   if (from._internal_has_pad_piece()) {
-    pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, from._internal_pad_piece(), 
-      GetArena());
+    pad_piece_.Set(from._internal_pad_piece(), 
+      GetArenaForAllocation());
   }
   ::memcpy(&self_test_sample_size_, &from.self_test_sample_size_,
     static_cast<size_t>(reinterpret_cast<char*>(&pad_id_) -
@@ -462,76 +491,76 @@ TrainerSpec::TrainerSpec(const TrainerSpec& from)
   // @@protoc_insertion_point(copy_constructor:sentencepiece.TrainerSpec)
 }
 
-void TrainerSpec::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto.base);
-  model_prefix_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  input_format_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  required_chars_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  unk_surface_.UnsafeSetDefault(nullptr);
-  unk_piece_.UnsafeSetDefault(nullptr);
-  bos_piece_.UnsafeSetDefault(nullptr);
-  eos_piece_.UnsafeSetDefault(nullptr);
-  pad_piece_.UnsafeSetDefault(nullptr);
-  ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
-      reinterpret_cast<char*>(&self_test_sample_size_) - reinterpret_cast<char*>(this)),
-      0, static_cast<size_t>(reinterpret_cast<char*>(&train_extremely_large_corpus_) -
-      reinterpret_cast<char*>(&self_test_sample_size_)) + sizeof(train_extremely_large_corpus_));
-  model_type_ = 1;
-  vocab_size_ = 8000;
-  character_coverage_ = 0.9995f;
-  seed_sentencepiece_size_ = 1000000;
-  shrinking_factor_ = 0.75f;
-  num_threads_ = 16;
-  num_sub_iterations_ = 2;
-  max_sentence_length_ = 4192;
-  max_sentencepiece_length_ = 16;
-  shuffle_input_sentence_ = true;
-  split_by_unicode_script_ = true;
-  split_by_number_ = true;
-  split_by_whitespace_ = true;
-  vocabulary_output_piece_score_ = true;
-  hard_vocab_limit_ = true;
-  bos_id_ = 1;
-  eos_id_ = 2;
-  pad_id_ = -1;
+inline void TrainerSpec::SharedCtor() {
+model_prefix_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  model_prefix_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+input_format_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  input_format_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+required_chars_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  required_chars_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+unk_surface_.InitDefault();
+unk_piece_.InitDefault();
+bos_piece_.InitDefault();
+eos_piece_.InitDefault();
+pad_piece_.InitDefault();
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&self_test_sample_size_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&train_extremely_large_corpus_) -
+    reinterpret_cast<char*>(&self_test_sample_size_)) + sizeof(train_extremely_large_corpus_));
+model_type_ = 1;
+vocab_size_ = 8000;
+character_coverage_ = 0.9995f;
+seed_sentencepiece_size_ = 1000000;
+shrinking_factor_ = 0.75f;
+num_threads_ = 16;
+num_sub_iterations_ = 2;
+max_sentence_length_ = 4192;
+max_sentencepiece_length_ = 16;
+shuffle_input_sentence_ = true;
+split_by_unicode_script_ = true;
+split_by_number_ = true;
+split_by_whitespace_ = true;
+vocabulary_output_piece_score_ = true;
+hard_vocab_limit_ = true;
+bos_id_ = 1;
+eos_id_ = 2;
+pad_id_ = -1;
 }
 
 TrainerSpec::~TrainerSpec() {
   // @@protoc_insertion_point(destructor:sentencepiece.TrainerSpec)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void TrainerSpec::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
-  model_prefix_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  input_format_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  required_chars_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  unk_surface_.DestroyNoArena(nullptr);
-  unk_piece_.DestroyNoArena(nullptr);
-  bos_piece_.DestroyNoArena(nullptr);
-  eos_piece_.DestroyNoArena(nullptr);
-  pad_piece_.DestroyNoArena(nullptr);
+inline void TrainerSpec::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  model_prefix_.Destroy();
+  input_format_.Destroy();
+  required_chars_.Destroy();
+  unk_surface_.Destroy();
+  unk_piece_.Destroy();
+  bos_piece_.Destroy();
+  eos_piece_.Destroy();
+  pad_piece_.Destroy();
 }
 
-void TrainerSpec::ArenaDtor(void* object) {
-  TrainerSpec* _this = reinterpret_cast< TrainerSpec* >(object);
-  (void)_this;
-}
-void TrainerSpec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void TrainerSpec::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const TrainerSpec& TrainerSpec::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TrainerSpec_sentencepiece_5fmodel_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void TrainerSpec::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.TrainerSpec)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -552,19 +581,19 @@ void TrainerSpec::Clear() {
       required_chars_.ClearNonDefaultToEmpty();
     }
     if (cached_has_bits & 0x00000008u) {
-      unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArena());
+      unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArenaForAllocation());
        }
     if (cached_has_bits & 0x00000010u) {
-      unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArena());
+      unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArenaForAllocation());
        }
     if (cached_has_bits & 0x00000020u) {
-      bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArena());
+      bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArenaForAllocation());
        }
     if (cached_has_bits & 0x00000040u) {
-      eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArena());
+      eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArenaForAllocation());
        }
     if (cached_has_bits & 0x00000080u) {
-      pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArena());
+      pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArenaForAllocation());
        }
   }
   if (cached_has_bits & 0x0000ff00u) {
@@ -604,397 +633,437 @@ void TrainerSpec::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* TrainerSpec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* TrainerSpec::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // repeated string input = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           ptr -= 1;
           do {
             ptr += 1;
             auto str = _internal_add_input();
-            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string model_prefix = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
           auto str = _internal_mutable_model_prefix();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
       case 3:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
-          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
           if (PROTOBUF_PREDICT_TRUE(::sentencepiece::TrainerSpec_ModelType_IsValid(val))) {
             _internal_set_model_type(static_cast<::sentencepiece::TrainerSpec_ModelType>(val));
           } else {
             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
           }
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 vocab_size = 4 [default = 8000];
       case 4:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
           _Internal::set_has_vocab_size(&_has_bits_);
-          vocab_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          vocab_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // repeated string accept_language = 5;
       case 5:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
           ptr -= 1;
           do {
             ptr += 1;
             auto str = _internal_add_accept_language();
-            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 self_test_sample_size = 6 [default = 0];
       case 6:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
           _Internal::set_has_self_test_sample_size(&_has_bits_);
-          self_test_sample_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          self_test_sample_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string input_format = 7;
       case 7:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
           auto str = _internal_mutable_input_format();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional float character_coverage = 10 [default = 0.9995];
       case 10:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 85)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 85)) {
           _Internal::set_has_character_coverage(&_has_bits_);
           character_coverage_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
           ptr += sizeof(float);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional uint64 input_sentence_size = 11 [default = 0];
       case 11:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
           _Internal::set_has_input_sentence_size(&_has_bits_);
           input_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 mining_sentence_size = 12 [deprecated = true];
       case 12:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
           _Internal::set_has_mining_sentence_size(&_has_bits_);
-          mining_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          mining_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 training_sentence_size = 13 [deprecated = true];
       case 13:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 104)) {
           _Internal::set_has_training_sentence_size(&_has_bits_);
-          training_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          training_sentence_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 seed_sentencepiece_size = 14 [default = 1000000];
       case 14:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
           _Internal::set_has_seed_sentencepiece_size(&_has_bits_);
-          seed_sentencepiece_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          seed_sentencepiece_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional float shrinking_factor = 15 [default = 0.75];
       case 15:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 125)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 125)) {
           _Internal::set_has_shrinking_factor(&_has_bits_);
           shrinking_factor_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
           ptr += sizeof(float);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 num_threads = 16 [default = 16];
       case 16:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
           _Internal::set_has_num_threads(&_has_bits_);
-          num_threads_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          num_threads_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 num_sub_iterations = 17 [default = 2];
       case 17:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
           _Internal::set_has_num_sub_iterations(&_has_bits_);
-          num_sub_iterations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          num_sub_iterations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 max_sentence_length = 18 [default = 4192];
       case 18:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
           _Internal::set_has_max_sentence_length(&_has_bits_);
-          max_sentence_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          max_sentence_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool shuffle_input_sentence = 19 [default = true];
       case 19:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
           _Internal::set_has_shuffle_input_sentence(&_has_bits_);
           shuffle_input_sentence_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 max_sentencepiece_length = 20 [default = 16];
       case 20:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
           _Internal::set_has_max_sentencepiece_length(&_has_bits_);
-          max_sentencepiece_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          max_sentencepiece_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool split_by_unicode_script = 21 [default = true];
       case 21:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 168)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
           _Internal::set_has_split_by_unicode_script(&_has_bits_);
           split_by_unicode_script_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool split_by_whitespace = 22 [default = true];
       case 22:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 176)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 176)) {
           _Internal::set_has_split_by_whitespace(&_has_bits_);
           split_by_whitespace_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool split_by_number = 23 [default = true];
       case 23:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 184)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 184)) {
           _Internal::set_has_split_by_number(&_has_bits_);
           split_by_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool treat_whitespace_as_suffix = 24 [default = false];
       case 24:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 192)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 192)) {
           _Internal::set_has_treat_whitespace_as_suffix(&_has_bits_);
           treat_whitespace_as_suffix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool split_digits = 25 [default = false];
       case 25:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 200)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 200)) {
           _Internal::set_has_split_digits(&_has_bits_);
           split_digits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool allow_whitespace_only_pieces = 26 [default = false];
       case 26:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 208)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 208)) {
           _Internal::set_has_allow_whitespace_only_pieces(&_has_bits_);
           allow_whitespace_only_pieces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // repeated string control_symbols = 30;
       case 30:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 242)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 242)) {
           ptr -= 2;
           do {
             ptr += 2;
             auto str = _internal_add_control_symbols();
-            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<242>(ptr));
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // repeated string user_defined_symbols = 31;
       case 31:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 250)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 250)) {
           ptr -= 2;
           do {
             ptr += 2;
             auto str = _internal_add_user_defined_symbols();
-            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+            ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<250>(ptr));
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool vocabulary_output_piece_score = 32 [default = true];
       case 32:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 0)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 0)) {
           _Internal::set_has_vocabulary_output_piece_score(&_has_bits_);
           vocabulary_output_piece_score_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool hard_vocab_limit = 33 [default = true];
       case 33:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
           _Internal::set_has_hard_vocab_limit(&_has_bits_);
           hard_vocab_limit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool use_all_vocab = 34 [default = false];
       case 34:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
           _Internal::set_has_use_all_vocab(&_has_bits_);
           use_all_vocab_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool byte_fallback = 35 [default = false];
       case 35:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
           _Internal::set_has_byte_fallback(&_has_bits_);
           byte_fallback_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string required_chars = 36;
       case 36:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
           auto str = _internal_mutable_required_chars();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 unk_id = 40 [default = 0];
       case 40:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
           _Internal::set_has_unk_id(&_has_bits_);
-          unk_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          unk_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 bos_id = 41 [default = 1];
       case 41:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
           _Internal::set_has_bos_id(&_has_bits_);
-          bos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          bos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 eos_id = 42 [default = 2];
       case 42:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
           _Internal::set_has_eos_id(&_has_bits_);
-          eos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          eos_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional int32 pad_id = 43 [default = -1];
       case 43:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
           _Internal::set_has_pad_id(&_has_bits_);
-          pad_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+          pad_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string unk_surface = 44 [default = " \342\201\207 "];
       case 44:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 98)) {
           auto str = _internal_mutable_unk_surface();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string unk_piece = 45 [default = "<unk>"];
       case 45:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 106)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
           auto str = _internal_mutable_unk_piece();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string bos_piece = 46 [default = "<s>"];
       case 46:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
           auto str = _internal_mutable_bos_piece();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string eos_piece = 47 [default = "</s>"];
       case 47:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 122)) {
           auto str = _internal_mutable_eos_piece();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string pad_piece = 48 [default = "<pad>"];
       case 48:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 130)) {
           auto str = _internal_mutable_pad_piece();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool train_extremely_large_corpus = 49 [default = false];
       case 49:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 136)) {
           _Internal::set_has_train_extremely_large_corpus(&_has_bits_);
           train_extremely_large_corpus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* TrainerSpec::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* TrainerSpec::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.TrainerSpec)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated string input = 1;
@@ -1013,14 +1082,14 @@ failure:
   // optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
   if (cached_has_bits & 0x00080000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+    target = ::_pbi::WireFormatLite::WriteEnumToArray(
       3, this->_internal_model_type(), target);
   }
 
   // optional int32 vocab_size = 4 [default = 8000];
   if (cached_has_bits & 0x00100000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_vocab_size(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_vocab_size(), target);
   }
 
   // repeated string accept_language = 5;
@@ -1032,7 +1101,7 @@ failure:
   // optional int32 self_test_sample_size = 6 [default = 0];
   if (cached_has_bits & 0x00000100u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(6, this->_internal_self_test_sample_size(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_self_test_sample_size(), target);
   }
 
   // optional string input_format = 7;
@@ -1044,103 +1113,103 @@ failure:
   // optional float character_coverage = 10 [default = 0.9995];
   if (cached_has_bits & 0x00200000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(10, this->_internal_character_coverage(), target);
+    target = ::_pbi::WireFormatLite::WriteFloatToArray(10, this->_internal_character_coverage(), target);
   }
 
   // optional uint64 input_sentence_size = 11 [default = 0];
   if (cached_has_bits & 0x00000400u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(11, this->_internal_input_sentence_size(), target);
+    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(11, this->_internal_input_sentence_size(), target);
   }
 
   // optional int32 mining_sentence_size = 12 [deprecated = true];
   if (cached_has_bits & 0x00000200u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(12, this->_internal_mining_sentence_size(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(12, this->_internal_mining_sentence_size(), target);
   }
 
   // optional int32 training_sentence_size = 13 [deprecated = true];
   if (cached_has_bits & 0x00000800u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(13, this->_internal_training_sentence_size(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(13, this->_internal_training_sentence_size(), target);
   }
 
   // optional int32 seed_sentencepiece_size = 14 [default = 1000000];
   if (cached_has_bits & 0x00400000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(14, this->_internal_seed_sentencepiece_size(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(14, this->_internal_seed_sentencepiece_size(), target);
   }
 
   // optional float shrinking_factor = 15 [default = 0.75];
   if (cached_has_bits & 0x00800000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(15, this->_internal_shrinking_factor(), target);
+    target = ::_pbi::WireFormatLite::WriteFloatToArray(15, this->_internal_shrinking_factor(), target);
   }
 
   // optional int32 num_threads = 16 [default = 16];
   if (cached_has_bits & 0x01000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(16, this->_internal_num_threads(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(16, this->_internal_num_threads(), target);
   }
 
   // optional int32 num_sub_iterations = 17 [default = 2];
   if (cached_has_bits & 0x02000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(17, this->_internal_num_sub_iterations(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(17, this->_internal_num_sub_iterations(), target);
   }
 
   // optional int32 max_sentence_length = 18 [default = 4192];
   if (cached_has_bits & 0x04000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(18, this->_internal_max_sentence_length(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(18, this->_internal_max_sentence_length(), target);
   }
 
   // optional bool shuffle_input_sentence = 19 [default = true];
   if (cached_has_bits & 0x10000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(19, this->_internal_shuffle_input_sentence(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(19, this->_internal_shuffle_input_sentence(), target);
   }
 
   // optional int32 max_sentencepiece_length = 20 [default = 16];
   if (cached_has_bits & 0x08000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(20, this->_internal_max_sentencepiece_length(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(20, this->_internal_max_sentencepiece_length(), target);
   }
 
   // optional bool split_by_unicode_script = 21 [default = true];
   if (cached_has_bits & 0x20000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(21, this->_internal_split_by_unicode_script(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(21, this->_internal_split_by_unicode_script(), target);
   }
 
   // optional bool split_by_whitespace = 22 [default = true];
   if (cached_has_bits & 0x80000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(22, this->_internal_split_by_whitespace(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(22, this->_internal_split_by_whitespace(), target);
   }
 
   // optional bool split_by_number = 23 [default = true];
   if (cached_has_bits & 0x40000000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(23, this->_internal_split_by_number(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(23, this->_internal_split_by_number(), target);
   }
 
   // optional bool treat_whitespace_as_suffix = 24 [default = false];
   if (cached_has_bits & 0x00001000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(24, this->_internal_treat_whitespace_as_suffix(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(24, this->_internal_treat_whitespace_as_suffix(), target);
   }
 
   // optional bool split_digits = 25 [default = false];
   if (cached_has_bits & 0x00004000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(25, this->_internal_split_digits(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(25, this->_internal_split_digits(), target);
   }
 
   // optional bool allow_whitespace_only_pieces = 26 [default = false];
   if (cached_has_bits & 0x00002000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(26, this->_internal_allow_whitespace_only_pieces(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(26, this->_internal_allow_whitespace_only_pieces(), target);
   }
 
   // repeated string control_symbols = 30;
@@ -1159,26 +1228,26 @@ failure:
   // optional bool vocabulary_output_piece_score = 32 [default = true];
   if (cached_has_bits & 0x00000001u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(32, this->_internal_vocabulary_output_piece_score(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(32, this->_internal_vocabulary_output_piece_score(), target);
   }
 
   // optional bool hard_vocab_limit = 33 [default = true];
   if (cached_has_bits & 0x00000002u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(33, this->_internal_hard_vocab_limit(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(33, this->_internal_hard_vocab_limit(), target);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional bool use_all_vocab = 34 [default = false];
   if (cached_has_bits & 0x00020000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(34, this->_internal_use_all_vocab(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(34, this->_internal_use_all_vocab(), target);
   }
 
   // optional bool byte_fallback = 35 [default = false];
   if (cached_has_bits & 0x00008000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(35, this->_internal_byte_fallback(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(35, this->_internal_byte_fallback(), target);
   }
 
   // optional string required_chars = 36;
@@ -1190,26 +1259,26 @@ failure:
   // optional int32 unk_id = 40 [default = 0];
   if (cached_has_bits & 0x00010000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(40, this->_internal_unk_id(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(40, this->_internal_unk_id(), target);
   }
 
   cached_has_bits = _has_bits_[1];
   // optional int32 bos_id = 41 [default = 1];
   if (cached_has_bits & 0x00000004u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(41, this->_internal_bos_id(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(41, this->_internal_bos_id(), target);
   }
 
   // optional int32 eos_id = 42 [default = 2];
   if (cached_has_bits & 0x00000008u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(42, this->_internal_eos_id(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(42, this->_internal_eos_id(), target);
   }
 
   // optional int32 pad_id = 43 [default = -1];
   if (cached_has_bits & 0x00000010u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(43, this->_internal_pad_id(), target);
+    target = ::_pbi::WireFormatLite::WriteInt32ToArray(43, this->_internal_pad_id(), target);
   }
 
   cached_has_bits = _has_bits_[0];
@@ -1246,12 +1315,12 @@ failure:
   // optional bool train_extremely_large_corpus = 49 [default = false];
   if (cached_has_bits & 0x00040000u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(49, this->_internal_train_extremely_large_corpus(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(49, this->_internal_train_extremely_large_corpus(), target);
   }
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -1267,7 +1336,7 @@ size_t TrainerSpec::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -1365,30 +1434,22 @@ size_t TrainerSpec::ByteSizeLong() const {
   if (cached_has_bits & 0x0000ff00u) {
     // optional int32 self_test_sample_size = 6 [default = 0];
     if (cached_has_bits & 0x00000100u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
-          this->_internal_self_test_sample_size());
+      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_self_test_sample_size());
     }
 
     // optional int32 mining_sentence_size = 12 [deprecated = true];
     if (cached_has_bits & 0x00000200u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
-          this->_internal_mining_sentence_size());
+      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mining_sentence_size());
     }
 
     // optional uint64 input_sentence_size = 11 [default = 0];
     if (cached_has_bits & 0x00000400u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size(
-          this->_internal_input_sentence_size());
+      total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_input_sentence_size());
     }
 
     // optional int32 training_sentence_size = 13 [deprecated = true];
     if (cached_has_bits & 0x00000800u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
-          this->_internal_training_sentence_size());
+      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_training_sentence_size());
     }
 
     // optional bool treat_whitespace_as_suffix = 24 [default = false];
@@ -1416,7 +1477,7 @@ size_t TrainerSpec::ByteSizeLong() const {
     // optional int32 unk_id = 40 [default = 0];
     if (cached_has_bits & 0x00010000u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_unk_id());
     }
 
@@ -1433,14 +1494,12 @@ size_t TrainerSpec::ByteSizeLong() const {
     // optional .sentencepiece.TrainerSpec.ModelType model_type = 3 [default = UNIGRAM];
     if (cached_has_bits & 0x00080000u) {
       total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_model_type());
+        ::_pbi::WireFormatLite::EnumSize(this->_internal_model_type());
     }
 
     // optional int32 vocab_size = 4 [default = 8000];
     if (cached_has_bits & 0x00100000u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
-          this->_internal_vocab_size());
+      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_vocab_size());
     }
 
     // optional float character_coverage = 10 [default = 0.9995];
@@ -1450,9 +1509,7 @@ size_t TrainerSpec::ByteSizeLong() const {
 
     // optional int32 seed_sentencepiece_size = 14 [default = 1000000];
     if (cached_has_bits & 0x00400000u) {
-      total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
-          this->_internal_seed_sentencepiece_size());
+      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_seed_sentencepiece_size());
     }
 
     // optional float shrinking_factor = 15 [default = 0.75];
@@ -1465,28 +1522,28 @@ size_t TrainerSpec::ByteSizeLong() const {
     // optional int32 num_threads = 16 [default = 16];
     if (cached_has_bits & 0x01000000u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_num_threads());
     }
 
     // optional int32 num_sub_iterations = 17 [default = 2];
     if (cached_has_bits & 0x02000000u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_num_sub_iterations());
     }
 
     // optional int32 max_sentence_length = 18 [default = 4192];
     if (cached_has_bits & 0x04000000u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_max_sentence_length());
     }
 
     // optional int32 max_sentencepiece_length = 20 [default = 16];
     if (cached_has_bits & 0x08000000u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_max_sentencepiece_length());
     }
 
@@ -1526,21 +1583,21 @@ size_t TrainerSpec::ByteSizeLong() const {
     // optional int32 bos_id = 41 [default = 1];
     if (cached_has_bits & 0x00000004u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_bos_id());
     }
 
     // optional int32 eos_id = 42 [default = 2];
     if (cached_has_bits & 0x00000008u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_eos_id());
     }
 
     // optional int32 pad_id = 43 [default = -1];
     if (cached_has_bits & 0x00000010u) {
       total_size += 2 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
+        ::_pbi::WireFormatLite::Int32Size(
           this->_internal_pad_id());
     }
 
@@ -1548,23 +1605,21 @@ size_t TrainerSpec::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void TrainerSpec::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const TrainerSpec*>(
+  MergeFrom(*::_pbi::DownCast<const TrainerSpec*>(
       &from));
 }
 
 void TrainerSpec::MergeFrom(const TrainerSpec& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.TrainerSpec)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   input_.MergeFrom(from.input_);
@@ -1698,6 +1753,8 @@ void TrainerSpec::MergeFrom(const TrainerSpec& from) {
     }
     _has_bits_[1] |= cached_has_bits;
   }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void TrainerSpec::CopyFrom(const TrainerSpec& from) {
@@ -1717,22 +1774,48 @@ bool TrainerSpec::IsInitialized() const {
 
 void TrainerSpec::InternalSwap(TrainerSpec* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   swap(_has_bits_[1], other->_has_bits_[1]);
   input_.InternalSwap(&other->input_);
   accept_language_.InternalSwap(&other->accept_language_);
   control_symbols_.InternalSwap(&other->control_symbols_);
   user_defined_symbols_.InternalSwap(&other->user_defined_symbols_);
-  model_prefix_.Swap(&other->model_prefix_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  input_format_.Swap(&other->input_format_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  required_chars_.Swap(&other->required_chars_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  unk_surface_.Swap(&other->unk_surface_, nullptr, GetArena());
-  unk_piece_.Swap(&other->unk_piece_, nullptr, GetArena());
-  bos_piece_.Swap(&other->bos_piece_, nullptr, GetArena());
-  eos_piece_.Swap(&other->eos_piece_, nullptr, GetArena());
-  pad_piece_.Swap(&other->pad_piece_, nullptr, GetArena());
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &model_prefix_, lhs_arena,
+      &other->model_prefix_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &input_format_, lhs_arena,
+      &other->input_format_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &required_chars_, lhs_arena,
+      &other->required_chars_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &unk_surface_, lhs_arena,
+      &other->unk_surface_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &unk_piece_, lhs_arena,
+      &other->unk_piece_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &bos_piece_, lhs_arena,
+      &other->bos_piece_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &eos_piece_, lhs_arena,
+      &other->eos_piece_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &pad_piece_, lhs_arena,
+      &other->pad_piece_, rhs_arena
+  );
   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
       PROTOBUF_FIELD_OFFSET(TrainerSpec, train_extremely_large_corpus_)
       + sizeof(TrainerSpec::train_extremely_large_corpus_)
@@ -1789,32 +1872,41 @@ class NormalizerSpec::_Internal {
   }
 };
 
-NormalizerSpec::NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+NormalizerSpec::NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.NormalizerSpec)
 }
 NormalizerSpec::NormalizerSpec(const NormalizerSpec& from)
   : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
       _has_bits_(from._has_bits_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
-  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  name_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    name_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_name()) {
-    name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_name(), 
-      GetArena());
+    name_.Set(from._internal_name(), 
+      GetArenaForAllocation());
   }
-  precompiled_charsmap_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  precompiled_charsmap_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    precompiled_charsmap_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_precompiled_charsmap()) {
-    precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_precompiled_charsmap(), 
-      GetArena());
+    precompiled_charsmap_.Set(from._internal_precompiled_charsmap(), 
+      GetArenaForAllocation());
   }
-  normalization_rule_tsv_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  normalization_rule_tsv_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    normalization_rule_tsv_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_normalization_rule_tsv()) {
-    normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_normalization_rule_tsv(), 
-      GetArena());
+    normalization_rule_tsv_.Set(from._internal_normalization_rule_tsv(), 
+      GetArenaForAllocation());
   }
   ::memcpy(&add_dummy_prefix_, &from.add_dummy_prefix_,
     static_cast<size_t>(reinterpret_cast<char*>(&escape_whitespaces_) -
@@ -1822,47 +1914,47 @@ NormalizerSpec::NormalizerSpec(const NormalizerSpec& from)
   // @@protoc_insertion_point(copy_constructor:sentencepiece.NormalizerSpec)
 }
 
-void NormalizerSpec::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto.base);
-  name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  precompiled_charsmap_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  normalization_rule_tsv_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  add_dummy_prefix_ = true;
-  remove_extra_whitespaces_ = true;
-  escape_whitespaces_ = true;
+inline void NormalizerSpec::SharedCtor() {
+name_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  name_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+precompiled_charsmap_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  precompiled_charsmap_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+normalization_rule_tsv_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  normalization_rule_tsv_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+add_dummy_prefix_ = true;
+remove_extra_whitespaces_ = true;
+escape_whitespaces_ = true;
 }
 
 NormalizerSpec::~NormalizerSpec() {
   // @@protoc_insertion_point(destructor:sentencepiece.NormalizerSpec)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void NormalizerSpec::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
-  name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  precompiled_charsmap_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  normalization_rule_tsv_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void NormalizerSpec::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  name_.Destroy();
+  precompiled_charsmap_.Destroy();
+  normalization_rule_tsv_.Destroy();
 }
 
-void NormalizerSpec::ArenaDtor(void* object) {
-  NormalizerSpec* _this = reinterpret_cast< NormalizerSpec* >(object);
-  (void)_this;
-}
-void NormalizerSpec::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void NormalizerSpec::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const NormalizerSpec& NormalizerSpec::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NormalizerSpec_sentencepiece_5fmodel_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void NormalizerSpec::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.NormalizerSpec)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -1886,95 +1978,100 @@ void NormalizerSpec::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* NormalizerSpec::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* NormalizerSpec::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   _Internal::HasBits has_bits{};
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // optional string name = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           auto str = _internal_mutable_name();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bytes precompiled_charsmap = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
           auto str = _internal_mutable_precompiled_charsmap();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool add_dummy_prefix = 3 [default = true];
       case 3:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
           _Internal::set_has_add_dummy_prefix(&has_bits);
           add_dummy_prefix_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool remove_extra_whitespaces = 4 [default = true];
       case 4:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
           _Internal::set_has_remove_extra_whitespaces(&has_bits);
           remove_extra_whitespaces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional bool escape_whitespaces = 5 [default = true];
       case 5:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
           _Internal::set_has_escape_whitespaces(&has_bits);
           escape_whitespaces_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string normalization_rule_tsv = 6;
       case 6:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
           auto str = _internal_mutable_normalization_rule_tsv();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   _has_bits_.Or(has_bits);
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* NormalizerSpec::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* NormalizerSpec::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.NormalizerSpec)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
@@ -1993,19 +2090,19 @@ failure:
   // optional bool add_dummy_prefix = 3 [default = true];
   if (cached_has_bits & 0x00000008u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_add_dummy_prefix(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_add_dummy_prefix(), target);
   }
 
   // optional bool remove_extra_whitespaces = 4 [default = true];
   if (cached_has_bits & 0x00000010u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_remove_extra_whitespaces(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_remove_extra_whitespaces(), target);
   }
 
   // optional bool escape_whitespaces = 5 [default = true];
   if (cached_has_bits & 0x00000020u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_escape_whitespaces(), target);
+    target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_escape_whitespaces(), target);
   }
 
   // optional string normalization_rule_tsv = 6;
@@ -2016,7 +2113,7 @@ failure:
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -2032,7 +2129,7 @@ size_t NormalizerSpec::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2078,23 +2175,21 @@ size_t NormalizerSpec::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void NormalizerSpec::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const NormalizerSpec*>(
+  MergeFrom(*::_pbi::DownCast<const NormalizerSpec*>(
       &from));
 }
 
 void NormalizerSpec::MergeFrom(const NormalizerSpec& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.NormalizerSpec)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
@@ -2119,6 +2214,8 @@ void NormalizerSpec::MergeFrom(const NormalizerSpec& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void NormalizerSpec::CopyFrom(const NormalizerSpec& from) {
@@ -2138,12 +2235,23 @@ bool NormalizerSpec::IsInitialized() const {
 
 void NormalizerSpec::InternalSwap(NormalizerSpec* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  precompiled_charsmap_.Swap(&other->precompiled_charsmap_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  normalization_rule_tsv_.Swap(&other->normalization_rule_tsv_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &name_, lhs_arena,
+      &other->name_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &precompiled_charsmap_, lhs_arena,
+      &other->precompiled_charsmap_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &normalization_rule_tsv_, lhs_arena,
+      &other->normalization_rule_tsv_, rhs_arena
+  );
   swap(add_dummy_prefix_, other->add_dummy_prefix_);
   swap(remove_extra_whitespaces_, other->remove_extra_whitespaces_);
   swap(escape_whitespaces_, other->escape_whitespaces_);
@@ -2167,65 +2275,68 @@ class SelfTestData_Sample::_Internal {
   }
 };
 
-SelfTestData_Sample::SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
+SelfTestData_Sample::SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.SelfTestData.Sample)
 }
 SelfTestData_Sample::SelfTestData_Sample(const SelfTestData_Sample& from)
   : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
       _has_bits_(from._has_bits_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  input_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  input_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    input_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_input()) {
-    input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_input(), 
-      GetArena());
+    input_.Set(from._internal_input(), 
+      GetArenaForAllocation());
   }
-  expected_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  expected_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    expected_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_expected()) {
-    expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_expected(), 
-      GetArena());
+    expected_.Set(from._internal_expected(), 
+      GetArenaForAllocation());
   }
   // @@protoc_insertion_point(copy_constructor:sentencepiece.SelfTestData.Sample)
 }
 
-void SelfTestData_Sample::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto.base);
-  input_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  expected_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SelfTestData_Sample::SharedCtor() {
+input_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  input_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+expected_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  expected_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
 }
 
 SelfTestData_Sample::~SelfTestData_Sample() {
   // @@protoc_insertion_point(destructor:sentencepiece.SelfTestData.Sample)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void SelfTestData_Sample::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
-  input_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  expected_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void SelfTestData_Sample::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  input_.Destroy();
+  expected_.Destroy();
 }
 
-void SelfTestData_Sample::ArenaDtor(void* object) {
-  SelfTestData_Sample* _this = reinterpret_cast< SelfTestData_Sample* >(object);
-  (void)_this;
-}
-void SelfTestData_Sample::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void SelfTestData_Sample::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const SelfTestData_Sample& SelfTestData_Sample::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SelfTestData_Sample_sentencepiece_5fmodel_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void SelfTestData_Sample::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.SelfTestData.Sample)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2242,57 +2353,59 @@ void SelfTestData_Sample::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* SelfTestData_Sample::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SelfTestData_Sample::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   _Internal::HasBits has_bits{};
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // optional string input = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           auto str = _internal_mutable_input();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional string expected = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
           auto str = _internal_mutable_expected();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   _has_bits_.Or(has_bits);
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* SelfTestData_Sample::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SelfTestData_Sample::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SelfTestData.Sample)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
@@ -2320,7 +2433,7 @@ size_t SelfTestData_Sample::ByteSizeLong() const {
 // @@protoc_insertion_point(message_byte_size_start:sentencepiece.SelfTestData.Sample)
   size_t total_size = 0;
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2344,22 +2457,21 @@ size_t SelfTestData_Sample::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void SelfTestData_Sample::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SelfTestData_Sample*>(
+  MergeFrom(*::_pbi::DownCast<const SelfTestData_Sample*>(
       &from));
 }
 
 void SelfTestData_Sample::MergeFrom(const SelfTestData_Sample& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SelfTestData.Sample)
   GOOGLE_DCHECK_NE(&from, this);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
@@ -2371,6 +2483,7 @@ void SelfTestData_Sample::MergeFrom(const SelfTestData_Sample& from) {
       _internal_set_expected(from._internal_expected());
     }
   }
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void SelfTestData_Sample::CopyFrom(const SelfTestData_Sample& from) {
@@ -2386,10 +2499,18 @@ bool SelfTestData_Sample::IsInitialized() const {
 
 void SelfTestData_Sample::InternalSwap(SelfTestData_Sample* other) {
   using std::swap;
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  input_.Swap(&other->input_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
-  expected_.Swap(&other->expected_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &input_, lhs_arena,
+      &other->input_, rhs_arena
+  );
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &expected_, lhs_arena,
+      &other->expected_, rhs_arena
+  );
 }
 
 std::string SelfTestData_Sample::GetTypeName() const {
@@ -2403,54 +2524,45 @@ class SelfTestData::_Internal {
  public:
 };
 
-SelfTestData::SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+SelfTestData::SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena),
   samples_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.SelfTestData)
 }
 SelfTestData::SelfTestData(const SelfTestData& from)
   : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
       samples_(from.samples_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   // @@protoc_insertion_point(copy_constructor:sentencepiece.SelfTestData)
 }
 
-void SelfTestData::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SelfTestData_sentencepiece_5fmodel_2eproto.base);
+inline void SelfTestData::SharedCtor() {
 }
 
 SelfTestData::~SelfTestData() {
   // @@protoc_insertion_point(destructor:sentencepiece.SelfTestData)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void SelfTestData::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
+inline void SelfTestData::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
 }
 
-void SelfTestData::ArenaDtor(void* object) {
-  SelfTestData* _this = reinterpret_cast< SelfTestData* >(object);
-  (void)_this;
-}
-void SelfTestData::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void SelfTestData::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const SelfTestData& SelfTestData::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SelfTestData_sentencepiece_5fmodel_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void SelfTestData::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.SelfTestData)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2459,16 +2571,15 @@ void SelfTestData::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* SelfTestData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* SelfTestData::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // repeated .sentencepiece.SelfTestData.Sample samples = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           ptr -= 1;
           do {
             ptr += 1;
@@ -2476,53 +2587,54 @@ const char* SelfTestData::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_I
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* SelfTestData::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* SelfTestData::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.SelfTestData)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .sentencepiece.SelfTestData.Sample samples = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->_internal_samples_size()); i < n; i++) {
-    target = stream->EnsureSpace(target);
+  for (unsigned i = 0,
+      n = static_cast<unsigned>(this->_internal_samples_size()); i < n; i++) {
+    const auto& repfield = this->_internal_samples(i);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(1, this->_internal_samples(i), target, stream);
+        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
   }
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -2538,7 +2650,7 @@ size_t SelfTestData::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2552,26 +2664,26 @@ size_t SelfTestData::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void SelfTestData::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SelfTestData*>(
+  MergeFrom(*::_pbi::DownCast<const SelfTestData*>(
       &from));
 }
 
 void SelfTestData::MergeFrom(const SelfTestData& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.SelfTestData)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   samples_.MergeFrom(from.samples_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void SelfTestData::CopyFrom(const SelfTestData& from) {
@@ -2591,8 +2703,8 @@ bool SelfTestData::IsInitialized() const {
 
 void SelfTestData::InternalSwap(SelfTestData* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   samples_.InternalSwap(&other->samples_);
 }
 
@@ -2617,22 +2729,25 @@ class ModelProto_SentencePiece::_Internal {
   }
 };
 
-ModelProto_SentencePiece::ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+ModelProto_SentencePiece::ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.ModelProto.SentencePiece)
 }
 ModelProto_SentencePiece::ModelProto_SentencePiece(const ModelProto_SentencePiece& from)
   : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
       _has_bits_(from._has_bits_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
-  piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  piece_.InitDefault();
+  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+    piece_.Set("", GetArenaForAllocation());
+  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   if (from._internal_has_piece()) {
-    piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_piece(), 
-      GetArena());
+    piece_.Set(from._internal_piece(), 
+      GetArenaForAllocation());
   }
   ::memcpy(&score_, &from.score_,
     static_cast<size_t>(reinterpret_cast<char*>(&type_) -
@@ -2640,42 +2755,36 @@ ModelProto_SentencePiece::ModelProto_SentencePiece(const ModelProto_SentencePiec
   // @@protoc_insertion_point(copy_constructor:sentencepiece.ModelProto.SentencePiece)
 }
 
-void ModelProto_SentencePiece::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto.base);
-  piece_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
-  score_ = 0;
-  type_ = 1;
+inline void ModelProto_SentencePiece::SharedCtor() {
+piece_.InitDefault();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  piece_.Set("", GetArenaForAllocation());
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+score_ = 0;
+type_ = 1;
 }
 
 ModelProto_SentencePiece::~ModelProto_SentencePiece() {
   // @@protoc_insertion_point(destructor:sentencepiece.ModelProto.SentencePiece)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void ModelProto_SentencePiece::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
-  piece_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
+inline void ModelProto_SentencePiece::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
+  piece_.Destroy();
 }
 
-void ModelProto_SentencePiece::ArenaDtor(void* object) {
-  ModelProto_SentencePiece* _this = reinterpret_cast< ModelProto_SentencePiece* >(object);
-  (void)_this;
-}
-void ModelProto_SentencePiece::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void ModelProto_SentencePiece::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const ModelProto_SentencePiece& ModelProto_SentencePiece::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ModelProto_SentencePiece_sentencepiece_5fmodel_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void ModelProto_SentencePiece::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.ModelProto.SentencePiece)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2692,75 +2801,77 @@ void ModelProto_SentencePiece::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* ModelProto_SentencePiece::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* ModelProto_SentencePiece::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   _Internal::HasBits has_bits{};
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // optional string piece = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           auto str = _internal_mutable_piece();
-          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
+          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional float score = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 21)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
           _Internal::set_has_score(&has_bits);
           score_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
           ptr += sizeof(float);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
       case 3:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
-          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
+          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
           CHK_(ptr);
           if (PROTOBUF_PREDICT_TRUE(::sentencepiece::ModelProto_SentencePiece_Type_IsValid(val))) {
             _internal_set_type(static_cast<::sentencepiece::ModelProto_SentencePiece_Type>(val));
           } else {
             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
           }
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   _has_bits_.Or(has_bits);
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* ModelProto_SentencePiece::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* ModelProto_SentencePiece::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.ModelProto.SentencePiece)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = _has_bits_[0];
@@ -2773,19 +2884,19 @@ failure:
   // optional float score = 2;
   if (cached_has_bits & 0x00000002u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(2, this->_internal_score(), target);
+    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_score(), target);
   }
 
   // optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
   if (cached_has_bits & 0x00000004u) {
     target = stream->EnsureSpace(target);
-    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
+    target = ::_pbi::WireFormatLite::WriteEnumToArray(
       3, this->_internal_type(), target);
   }
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -2801,7 +2912,7 @@ size_t ModelProto_SentencePiece::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -2822,30 +2933,28 @@ size_t ModelProto_SentencePiece::ByteSizeLong() const {
     // optional .sentencepiece.ModelProto.SentencePiece.Type type = 3 [default = NORMAL];
     if (cached_has_bits & 0x00000004u) {
       total_size += 1 +
-        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
+        ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
     }
 
   }
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void ModelProto_SentencePiece::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ModelProto_SentencePiece*>(
+  MergeFrom(*::_pbi::DownCast<const ModelProto_SentencePiece*>(
       &from));
 }
 
 void ModelProto_SentencePiece::MergeFrom(const ModelProto_SentencePiece& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.ModelProto.SentencePiece)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   cached_has_bits = from._has_bits_[0];
@@ -2861,6 +2970,8 @@ void ModelProto_SentencePiece::MergeFrom(const ModelProto_SentencePiece& from) {
     }
     _has_bits_[0] |= cached_has_bits;
   }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void ModelProto_SentencePiece::CopyFrom(const ModelProto_SentencePiece& from) {
@@ -2880,10 +2991,15 @@ bool ModelProto_SentencePiece::IsInitialized() const {
 
 void ModelProto_SentencePiece::InternalSwap(ModelProto_SentencePiece* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  auto* lhs_arena = GetArenaForAllocation();
+  auto* rhs_arena = other->GetArenaForAllocation();
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
-  piece_.Swap(&other->piece_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
+      &piece_, lhs_arena,
+      &other->piece_, rhs_arena
+  );
   swap(score_, other->score_);
   swap(type_, other->type_);
 }
@@ -2932,12 +3048,12 @@ const ::sentencepiece::NormalizerSpec&
 ModelProto::_Internal::denormalizer_spec(const ModelProto* msg) {
   return *msg->denormalizer_spec_;
 }
-ModelProto::ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena)
-  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
+ModelProto::ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                         bool is_message_owned)
+  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned),
   _extensions_(arena),
   pieces_(arena) {
   SharedCtor();
-  RegisterArenaDtor(arena);
   // @@protoc_insertion_point(arena_constructor:sentencepiece.ModelProto)
 }
 ModelProto::ModelProto(const ModelProto& from)
@@ -2945,7 +3061,7 @@ ModelProto::ModelProto(const ModelProto& from)
       _has_bits_(from._has_bits_),
       pieces_(from.pieces_) {
   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  _extensions_.MergeFrom(from._extensions_);
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
   if (from._internal_has_trainer_spec()) {
     trainer_spec_ = new ::sentencepiece::TrainerSpec(*from.trainer_spec_);
   } else {
@@ -2969,46 +3085,37 @@ ModelProto::ModelProto(const ModelProto& from)
   // @@protoc_insertion_point(copy_constructor:sentencepiece.ModelProto)
 }
 
-void ModelProto::SharedCtor() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ModelProto_sentencepiece_5fmodel_2eproto.base);
-  ::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
-      reinterpret_cast<char*>(&trainer_spec_) - reinterpret_cast<char*>(this)),
-      0, static_cast<size_t>(reinterpret_cast<char*>(&denormalizer_spec_) -
-      reinterpret_cast<char*>(&trainer_spec_)) + sizeof(denormalizer_spec_));
+inline void ModelProto::SharedCtor() {
+::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
+    reinterpret_cast<char*>(&trainer_spec_) - reinterpret_cast<char*>(this)),
+    0, static_cast<size_t>(reinterpret_cast<char*>(&denormalizer_spec_) -
+    reinterpret_cast<char*>(&trainer_spec_)) + sizeof(denormalizer_spec_));
 }
 
 ModelProto::~ModelProto() {
   // @@protoc_insertion_point(destructor:sentencepiece.ModelProto)
+  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
+  (void)arena;
+    return;
+  }
   SharedDtor();
-  _internal_metadata_.Delete<std::string>();
 }
 
-void ModelProto::SharedDtor() {
-  GOOGLE_DCHECK(GetArena() == nullptr);
+inline void ModelProto::SharedDtor() {
+  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
   if (this != internal_default_instance()) delete trainer_spec_;
   if (this != internal_default_instance()) delete normalizer_spec_;
   if (this != internal_default_instance()) delete self_test_data_;
   if (this != internal_default_instance()) delete denormalizer_spec_;
 }
 
-void ModelProto::ArenaDtor(void* object) {
-  ModelProto* _this = reinterpret_cast< ModelProto* >(object);
-  (void)_this;
-}
-void ModelProto::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
-}
 void ModelProto::SetCachedSize(int size) const {
   _cached_size_.Set(size);
 }
-const ModelProto& ModelProto::default_instance() {
-  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ModelProto_sentencepiece_5fmodel_2eproto.base);
-  return *internal_default_instance();
-}
-
 
 void ModelProto::Clear() {
 // @@protoc_insertion_point(message_clear_start:sentencepiece.ModelProto)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -3037,17 +3144,16 @@ void ModelProto::Clear() {
   _internal_metadata_.Clear<std::string>();
 }
 
-const char* ModelProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
+const char* ModelProto::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
   _Internal::HasBits has_bits{};
   while (!ctx->Done(&ptr)) {
-    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
-    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
-    CHK_(ptr);
+    uint32_t tag;
+    ptr = ::_pbi::ReadTag(ptr, &tag);
     switch (tag >> 3) {
       // repeated .sentencepiece.ModelProto.SentencePiece pieces = 1;
       case 1:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
           ptr -= 1;
           do {
             ptr += 1;
@@ -3055,115 +3161,116 @@ const char* ModelProto::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID:
             CHK_(ptr);
             if (!ctx->DataAvailable(ptr)) break;
           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional .sentencepiece.TrainerSpec trainer_spec = 2;
       case 2:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
           ptr = ctx->ParseMessage(_internal_mutable_trainer_spec(), ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional .sentencepiece.NormalizerSpec normalizer_spec = 3;
       case 3:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
           ptr = ctx->ParseMessage(_internal_mutable_normalizer_spec(), ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional .sentencepiece.SelfTestData self_test_data = 4;
       case 4:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
           ptr = ctx->ParseMessage(_internal_mutable_self_test_data(), ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
+        } else
+          goto handle_unusual;
         continue;
       // optional .sentencepiece.NormalizerSpec denormalizer_spec = 5;
       case 5:
-        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
+        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
           ptr = ctx->ParseMessage(_internal_mutable_denormalizer_spec(), ptr);
           CHK_(ptr);
-        } else goto handle_unusual;
-        continue;
-      default: {
-      handle_unusual:
-        if ((tag & 7) == 4 || tag == 0) {
-          ctx->SetLastTag(tag);
-          goto success;
-        }
-      if ((1600u <= tag)) {
-        ptr = _extensions_.ParseField(tag, ptr,
-            internal_default_instance(), &_internal_metadata_, ctx);
-        CHK_(ptr != nullptr);
+        } else
+          goto handle_unusual;
         continue;
-      }
-        ptr = UnknownFieldParse(tag,
-            _internal_metadata_.mutable_unknown_fields<std::string>(),
-            ptr, ctx);
-        CHK_(ptr != nullptr);
-        continue;
-      }
+      default:
+        goto handle_unusual;
     }  // switch
+  handle_unusual:
+    if ((tag == 0) || ((tag & 7) == 4)) {
+      CHK_(ptr);
+      ctx->SetLastTag(tag);
+      goto message_done;
+    }
+    if ((1600u <= tag)) {
+      ptr = _extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
+      CHK_(ptr != nullptr);
+      continue;
+    }
+    ptr = UnknownFieldParse(
+        tag,
+        _internal_metadata_.mutable_unknown_fields<std::string>(),
+        ptr, ctx);
+    CHK_(ptr != nullptr);
   }  // while
-success:
+message_done:
   _has_bits_.Or(has_bits);
   return ptr;
 failure:
   ptr = nullptr;
-  goto success;
+  goto message_done;
 #undef CHK_
 }
 
-::PROTOBUF_NAMESPACE_ID::uint8* ModelProto::_InternalSerialize(
-    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
+uint8_t* ModelProto::_InternalSerialize(
+    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
   // @@protoc_insertion_point(serialize_to_array_start:sentencepiece.ModelProto)
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   // repeated .sentencepiece.ModelProto.SentencePiece pieces = 1;
-  for (unsigned int i = 0,
-      n = static_cast<unsigned int>(this->_internal_pieces_size()); i < n; i++) {
-    target = stream->EnsureSpace(target);
+  for (unsigned i = 0,
+      n = static_cast<unsigned>(this->_internal_pieces_size()); i < n; i++) {
+    const auto& repfield = this->_internal_pieces(i);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(1, this->_internal_pieces(i), target, stream);
+        InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
   }
 
   cached_has_bits = _has_bits_[0];
   // optional .sentencepiece.TrainerSpec trainer_spec = 2;
   if (cached_has_bits & 0x00000001u) {
-    target = stream->EnsureSpace(target);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(
-        2, _Internal::trainer_spec(this), target, stream);
+      InternalWriteMessage(2, _Internal::trainer_spec(this),
+        _Internal::trainer_spec(this).GetCachedSize(), target, stream);
   }
 
   // optional .sentencepiece.NormalizerSpec normalizer_spec = 3;
   if (cached_has_bits & 0x00000002u) {
-    target = stream->EnsureSpace(target);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(
-        3, _Internal::normalizer_spec(this), target, stream);
+      InternalWriteMessage(3, _Internal::normalizer_spec(this),
+        _Internal::normalizer_spec(this).GetCachedSize(), target, stream);
   }
 
   // optional .sentencepiece.SelfTestData self_test_data = 4;
   if (cached_has_bits & 0x00000004u) {
-    target = stream->EnsureSpace(target);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(
-        4, _Internal::self_test_data(this), target, stream);
+      InternalWriteMessage(4, _Internal::self_test_data(this),
+        _Internal::self_test_data(this).GetCachedSize(), target, stream);
   }
 
   // optional .sentencepiece.NormalizerSpec denormalizer_spec = 5;
   if (cached_has_bits & 0x00000008u) {
-    target = stream->EnsureSpace(target);
     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
-      InternalWriteMessage(
-        5, _Internal::denormalizer_spec(this), target, stream);
+      InternalWriteMessage(5, _Internal::denormalizer_spec(this),
+        _Internal::denormalizer_spec(this).GetCachedSize(), target, stream);
   }
 
   // Extension range [200, 536870912)
   target = _extensions_._InternalSerialize(
-      200, 536870912, target, stream);
+  internal_default_instance(), 200, 536870912, target, stream);
 
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
@@ -3179,7 +3286,7 @@ size_t ModelProto::ByteSizeLong() const {
 
   total_size += _extensions_.ByteSize();
 
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   // Prevent compiler warnings about cached_has_bits being unused
   (void) cached_has_bits;
 
@@ -3224,23 +3331,21 @@ size_t ModelProto::ByteSizeLong() const {
   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
   }
-  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
+  int cached_size = ::_pbi::ToCachedSize(total_size);
   SetCachedSize(cached_size);
   return total_size;
 }
 
 void ModelProto::CheckTypeAndMergeFrom(
     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
-  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ModelProto*>(
+  MergeFrom(*::_pbi::DownCast<const ModelProto*>(
       &from));
 }
 
 void ModelProto::MergeFrom(const ModelProto& from) {
 // @@protoc_insertion_point(class_specific_merge_from_start:sentencepiece.ModelProto)
   GOOGLE_DCHECK_NE(&from, this);
-  _extensions_.MergeFrom(from._extensions_);
-  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
-  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
+  uint32_t cached_has_bits = 0;
   (void) cached_has_bits;
 
   pieces_.MergeFrom(from.pieces_);
@@ -3259,6 +3364,8 @@ void ModelProto::MergeFrom(const ModelProto& from) {
       _internal_mutable_denormalizer_spec()->::sentencepiece::NormalizerSpec::MergeFrom(from._internal_denormalizer_spec());
     }
   }
+  _extensions_.MergeFrom(internal_default_instance(), from._extensions_);
+  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
 }
 
 void ModelProto::CopyFrom(const ModelProto& from) {
@@ -3273,7 +3380,8 @@ bool ModelProto::IsInitialized() const {
     return false;
   }
 
-  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(pieces_)) return false;
+  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(pieces_))
+    return false;
   if (_internal_has_trainer_spec()) {
     if (!trainer_spec_->IsInitialized()) return false;
   }
@@ -3291,8 +3399,8 @@ bool ModelProto::IsInitialized() const {
 
 void ModelProto::InternalSwap(ModelProto* other) {
   using std::swap;
-  _extensions_.Swap(&other->_extensions_);
-  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
+  _extensions_.InternalSwap(&other->_extensions_);
+  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
   swap(_has_bits_[0], other->_has_bits_[0]);
   pieces_.InternalSwap(&other->pieces_);
   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
@@ -3311,22 +3419,28 @@ std::string ModelProto::GetTypeName() const {
 // @@protoc_insertion_point(namespace_scope)
 }  // namespace sentencepiece
 PROTOBUF_NAMESPACE_OPEN
-template<> PROTOBUF_NOINLINE ::sentencepiece::TrainerSpec* Arena::CreateMaybeMessage< ::sentencepiece::TrainerSpec >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::TrainerSpec*
+Arena::CreateMaybeMessage< ::sentencepiece::TrainerSpec >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::TrainerSpec >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::NormalizerSpec* Arena::CreateMaybeMessage< ::sentencepiece::NormalizerSpec >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::NormalizerSpec*
+Arena::CreateMaybeMessage< ::sentencepiece::NormalizerSpec >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::NormalizerSpec >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData_Sample* Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData_Sample >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData_Sample*
+Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData_Sample >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::SelfTestData_Sample >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData* Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::SelfTestData*
+Arena::CreateMaybeMessage< ::sentencepiece::SelfTestData >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::SelfTestData >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto_SentencePiece* Arena::CreateMaybeMessage< ::sentencepiece::ModelProto_SentencePiece >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto_SentencePiece*
+Arena::CreateMaybeMessage< ::sentencepiece::ModelProto_SentencePiece >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::ModelProto_SentencePiece >(arena);
 }
-template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto* Arena::CreateMaybeMessage< ::sentencepiece::ModelProto >(Arena* arena) {
+template<> PROTOBUF_NOINLINE ::sentencepiece::ModelProto*
+Arena::CreateMaybeMessage< ::sentencepiece::ModelProto >(Arena* arena) {
   return Arena::CreateMessageInternal< ::sentencepiece::ModelProto >(arena);
 }
 PROTOBUF_NAMESPACE_CLOSE
diff --git a/src/builtin_pb/sentencepiece_model.pb.h b/src/builtin_pb/sentencepiece_model.pb.h
index f527aa7..1799b08 100644
--- a/src/builtin_pb/sentencepiece_model.pb.h
+++ b/src/builtin_pb/sentencepiece_model.pb.h
@@ -8,12 +8,12 @@
 #include <string>
 
 #include <google/protobuf/port_def.inc>
-#if PROTOBUF_VERSION < 3014000
+#if PROTOBUF_VERSION < 3020000
 #error This file was generated by a newer version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please update
 #error your headers.
 #endif
-#if 3014000 < PROTOBUF_MIN_PROTOC_VERSION
+#if 3020002 < PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers. Please
 #error regenerate this file with a newer version of protoc.
@@ -23,7 +23,6 @@
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/arena.h>
 #include <google/protobuf/arenastring.h>
-#include <google/protobuf/generated_message_table_driven.h>
 #include <google/protobuf/generated_message_util.h>
 #include <google/protobuf/metadata_lite.h>
 #include <google/protobuf/message_lite.h>
@@ -41,34 +40,26 @@ PROTOBUF_NAMESPACE_CLOSE
 
 // Internal implementation detail -- do not use these members.
 struct TableStruct_sentencepiece_5fmodel_2eproto {
-  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
-    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
-    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[6]
-    PROTOBUF_SECTION_VARIABLE(protodesc_cold);
-  static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
-  static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
-  static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
+  static const uint32_t offsets[];
 };
 namespace sentencepiece {
 class ModelProto;
-class ModelProtoDefaultTypeInternal;
+struct ModelProtoDefaultTypeInternal;
 extern ModelProtoDefaultTypeInternal _ModelProto_default_instance_;
 class ModelProto_SentencePiece;
-class ModelProto_SentencePieceDefaultTypeInternal;
+struct ModelProto_SentencePieceDefaultTypeInternal;
 extern ModelProto_SentencePieceDefaultTypeInternal _ModelProto_SentencePiece_default_instance_;
 class NormalizerSpec;
-class NormalizerSpecDefaultTypeInternal;
+struct NormalizerSpecDefaultTypeInternal;
 extern NormalizerSpecDefaultTypeInternal _NormalizerSpec_default_instance_;
 class SelfTestData;
-class SelfTestDataDefaultTypeInternal;
+struct SelfTestDataDefaultTypeInternal;
 extern SelfTestDataDefaultTypeInternal _SelfTestData_default_instance_;
 class SelfTestData_Sample;
-class SelfTestData_SampleDefaultTypeInternal;
+struct SelfTestData_SampleDefaultTypeInternal;
 extern SelfTestData_SampleDefaultTypeInternal _SelfTestData_Sample_default_instance_;
 class TrainerSpec;
-class TrainerSpecDefaultTypeInternal;
+struct TrainerSpecDefaultTypeInternal;
 extern TrainerSpecDefaultTypeInternal _TrainerSpec_default_instance_;
 }  // namespace sentencepiece
 PROTOBUF_NAMESPACE_OPEN
@@ -127,11 +118,12 @@ bool ModelProto_SentencePiece_Type_Parse(
     ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ModelProto_SentencePiece_Type* value);
 // ===================================================================
 
-class TrainerSpec PROTOBUF_FINAL :
+class TrainerSpec final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.TrainerSpec) */ {
  public:
   inline TrainerSpec() : TrainerSpec(nullptr) {}
-  virtual ~TrainerSpec();
+  ~TrainerSpec() override;
+  explicit PROTOBUF_CONSTEXPR TrainerSpec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   TrainerSpec(const TrainerSpec& from);
   TrainerSpec(TrainerSpec&& from) noexcept
@@ -144,8 +136,13 @@ class TrainerSpec PROTOBUF_FINAL :
     return *this;
   }
   inline TrainerSpec& operator=(TrainerSpec&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -159,8 +156,9 @@ class TrainerSpec PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const TrainerSpec& default_instance();
-
+  static const TrainerSpec& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const TrainerSpec* internal_default_instance() {
     return reinterpret_cast<const TrainerSpec*>(
                &_TrainerSpec_default_instance_);
@@ -173,7 +171,12 @@ class TrainerSpec PROTOBUF_FINAL :
   }
   inline void Swap(TrainerSpec* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -181,21 +184,16 @@ class TrainerSpec PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(TrainerSpec* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline TrainerSpec* New() const final {
-    return CreateMaybeMessage<TrainerSpec>(nullptr);
-  }
-
-  TrainerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  TrainerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<TrainerSpec>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const TrainerSpec& from);
   void MergeFrom(const TrainerSpec& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -203,25 +201,24 @@ class TrainerSpec PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(TrainerSpec* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.TrainerSpec";
   }
   protected:
-  explicit TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit TrainerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -406,16 +403,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_model_prefix();
   const std::string& model_prefix() const;
-  void set_model_prefix(const std::string& value);
-  void set_model_prefix(std::string&& value);
-  void set_model_prefix(const char* value);
-  void set_model_prefix(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_model_prefix(ArgT0&& arg0, ArgT... args);
   std::string* mutable_model_prefix();
-  std::string* release_model_prefix();
+  PROTOBUF_NODISCARD std::string* release_model_prefix();
   void set_allocated_model_prefix(std::string* model_prefix);
   private:
   const std::string& _internal_model_prefix() const;
-  void _internal_set_model_prefix(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_model_prefix(const std::string& value);
   std::string* _internal_mutable_model_prefix();
   public:
 
@@ -426,16 +421,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_input_format();
   const std::string& input_format() const;
-  void set_input_format(const std::string& value);
-  void set_input_format(std::string&& value);
-  void set_input_format(const char* value);
-  void set_input_format(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_input_format(ArgT0&& arg0, ArgT... args);
   std::string* mutable_input_format();
-  std::string* release_input_format();
+  PROTOBUF_NODISCARD std::string* release_input_format();
   void set_allocated_input_format(std::string* input_format);
   private:
   const std::string& _internal_input_format() const;
-  void _internal_set_input_format(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_input_format(const std::string& value);
   std::string* _internal_mutable_input_format();
   public:
 
@@ -446,16 +439,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_required_chars();
   const std::string& required_chars() const;
-  void set_required_chars(const std::string& value);
-  void set_required_chars(std::string&& value);
-  void set_required_chars(const char* value);
-  void set_required_chars(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_required_chars(ArgT0&& arg0, ArgT... args);
   std::string* mutable_required_chars();
-  std::string* release_required_chars();
+  PROTOBUF_NODISCARD std::string* release_required_chars();
   void set_allocated_required_chars(std::string* required_chars);
   private:
   const std::string& _internal_required_chars() const;
-  void _internal_set_required_chars(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_required_chars(const std::string& value);
   std::string* _internal_mutable_required_chars();
   public:
 
@@ -466,16 +457,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_unk_surface();
   const std::string& unk_surface() const;
-  void set_unk_surface(const std::string& value);
-  void set_unk_surface(std::string&& value);
-  void set_unk_surface(const char* value);
-  void set_unk_surface(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_unk_surface(ArgT0&& arg0, ArgT... args);
   std::string* mutable_unk_surface();
-  std::string* release_unk_surface();
+  PROTOBUF_NODISCARD std::string* release_unk_surface();
   void set_allocated_unk_surface(std::string* unk_surface);
   private:
   const std::string& _internal_unk_surface() const;
-  void _internal_set_unk_surface(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_unk_surface(const std::string& value);
   std::string* _internal_mutable_unk_surface();
   public:
 
@@ -486,16 +475,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_unk_piece();
   const std::string& unk_piece() const;
-  void set_unk_piece(const std::string& value);
-  void set_unk_piece(std::string&& value);
-  void set_unk_piece(const char* value);
-  void set_unk_piece(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_unk_piece(ArgT0&& arg0, ArgT... args);
   std::string* mutable_unk_piece();
-  std::string* release_unk_piece();
+  PROTOBUF_NODISCARD std::string* release_unk_piece();
   void set_allocated_unk_piece(std::string* unk_piece);
   private:
   const std::string& _internal_unk_piece() const;
-  void _internal_set_unk_piece(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_unk_piece(const std::string& value);
   std::string* _internal_mutable_unk_piece();
   public:
 
@@ -506,16 +493,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_bos_piece();
   const std::string& bos_piece() const;
-  void set_bos_piece(const std::string& value);
-  void set_bos_piece(std::string&& value);
-  void set_bos_piece(const char* value);
-  void set_bos_piece(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_bos_piece(ArgT0&& arg0, ArgT... args);
   std::string* mutable_bos_piece();
-  std::string* release_bos_piece();
+  PROTOBUF_NODISCARD std::string* release_bos_piece();
   void set_allocated_bos_piece(std::string* bos_piece);
   private:
   const std::string& _internal_bos_piece() const;
-  void _internal_set_bos_piece(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_bos_piece(const std::string& value);
   std::string* _internal_mutable_bos_piece();
   public:
 
@@ -526,16 +511,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_eos_piece();
   const std::string& eos_piece() const;
-  void set_eos_piece(const std::string& value);
-  void set_eos_piece(std::string&& value);
-  void set_eos_piece(const char* value);
-  void set_eos_piece(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_eos_piece(ArgT0&& arg0, ArgT... args);
   std::string* mutable_eos_piece();
-  std::string* release_eos_piece();
+  PROTOBUF_NODISCARD std::string* release_eos_piece();
   void set_allocated_eos_piece(std::string* eos_piece);
   private:
   const std::string& _internal_eos_piece() const;
-  void _internal_set_eos_piece(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_eos_piece(const std::string& value);
   std::string* _internal_mutable_eos_piece();
   public:
 
@@ -546,16 +529,14 @@ class TrainerSpec PROTOBUF_FINAL :
   public:
   void clear_pad_piece();
   const std::string& pad_piece() const;
-  void set_pad_piece(const std::string& value);
-  void set_pad_piece(std::string&& value);
-  void set_pad_piece(const char* value);
-  void set_pad_piece(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_pad_piece(ArgT0&& arg0, ArgT... args);
   std::string* mutable_pad_piece();
-  std::string* release_pad_piece();
+  PROTOBUF_NODISCARD std::string* release_pad_piece();
   void set_allocated_pad_piece(std::string* pad_piece);
   private:
   const std::string& _internal_pad_piece() const;
-  void _internal_set_pad_piece(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_pad_piece(const std::string& value);
   std::string* _internal_mutable_pad_piece();
   public:
 
@@ -565,11 +546,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_self_test_sample_size() const;
   public:
   void clear_self_test_sample_size();
-  ::PROTOBUF_NAMESPACE_ID::int32 self_test_sample_size() const;
-  void set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t self_test_sample_size() const;
+  void set_self_test_sample_size(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_self_test_sample_size() const;
-  void _internal_set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_self_test_sample_size() const;
+  void _internal_set_self_test_sample_size(int32_t value);
   public:
 
   // optional int32 mining_sentence_size = 12 [deprecated = true];
@@ -578,11 +559,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_mining_sentence_size() const;
   public:
   PROTOBUF_DEPRECATED void clear_mining_sentence_size();
-  PROTOBUF_DEPRECATED ::PROTOBUF_NAMESPACE_ID::int32 mining_sentence_size() const;
-  PROTOBUF_DEPRECATED void set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  PROTOBUF_DEPRECATED int32_t mining_sentence_size() const;
+  PROTOBUF_DEPRECATED void set_mining_sentence_size(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_mining_sentence_size() const;
-  void _internal_set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_mining_sentence_size() const;
+  void _internal_set_mining_sentence_size(int32_t value);
   public:
 
   // optional uint64 input_sentence_size = 11 [default = 0];
@@ -591,11 +572,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_input_sentence_size() const;
   public:
   void clear_input_sentence_size();
-  ::PROTOBUF_NAMESPACE_ID::uint64 input_sentence_size() const;
-  void set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value);
+  uint64_t input_sentence_size() const;
+  void set_input_sentence_size(uint64_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::uint64 _internal_input_sentence_size() const;
-  void _internal_set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value);
+  uint64_t _internal_input_sentence_size() const;
+  void _internal_set_input_sentence_size(uint64_t value);
   public:
 
   // optional int32 training_sentence_size = 13 [deprecated = true];
@@ -604,11 +585,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_training_sentence_size() const;
   public:
   PROTOBUF_DEPRECATED void clear_training_sentence_size();
-  PROTOBUF_DEPRECATED ::PROTOBUF_NAMESPACE_ID::int32 training_sentence_size() const;
-  PROTOBUF_DEPRECATED void set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  PROTOBUF_DEPRECATED int32_t training_sentence_size() const;
+  PROTOBUF_DEPRECATED void set_training_sentence_size(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_training_sentence_size() const;
-  void _internal_set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_training_sentence_size() const;
+  void _internal_set_training_sentence_size(int32_t value);
   public:
 
   // optional bool treat_whitespace_as_suffix = 24 [default = false];
@@ -669,11 +650,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_unk_id() const;
   public:
   void clear_unk_id();
-  ::PROTOBUF_NAMESPACE_ID::int32 unk_id() const;
-  void set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t unk_id() const;
+  void set_unk_id(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_unk_id() const;
-  void _internal_set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_unk_id() const;
+  void _internal_set_unk_id(int32_t value);
   public:
 
   // optional bool use_all_vocab = 34 [default = false];
@@ -721,11 +702,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_vocab_size() const;
   public:
   void clear_vocab_size();
-  ::PROTOBUF_NAMESPACE_ID::int32 vocab_size() const;
-  void set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t vocab_size() const;
+  void set_vocab_size(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_vocab_size() const;
-  void _internal_set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_vocab_size() const;
+  void _internal_set_vocab_size(int32_t value);
   public:
 
   // optional float character_coverage = 10 [default = 0.9995];
@@ -747,11 +728,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_seed_sentencepiece_size() const;
   public:
   void clear_seed_sentencepiece_size();
-  ::PROTOBUF_NAMESPACE_ID::int32 seed_sentencepiece_size() const;
-  void set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t seed_sentencepiece_size() const;
+  void set_seed_sentencepiece_size(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_seed_sentencepiece_size() const;
-  void _internal_set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_seed_sentencepiece_size() const;
+  void _internal_set_seed_sentencepiece_size(int32_t value);
   public:
 
   // optional float shrinking_factor = 15 [default = 0.75];
@@ -773,11 +754,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_num_threads() const;
   public:
   void clear_num_threads();
-  ::PROTOBUF_NAMESPACE_ID::int32 num_threads() const;
-  void set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t num_threads() const;
+  void set_num_threads(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_num_threads() const;
-  void _internal_set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_num_threads() const;
+  void _internal_set_num_threads(int32_t value);
   public:
 
   // optional int32 num_sub_iterations = 17 [default = 2];
@@ -786,11 +767,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_num_sub_iterations() const;
   public:
   void clear_num_sub_iterations();
-  ::PROTOBUF_NAMESPACE_ID::int32 num_sub_iterations() const;
-  void set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t num_sub_iterations() const;
+  void set_num_sub_iterations(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_num_sub_iterations() const;
-  void _internal_set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_num_sub_iterations() const;
+  void _internal_set_num_sub_iterations(int32_t value);
   public:
 
   // optional int32 max_sentence_length = 18 [default = 4192];
@@ -799,11 +780,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_max_sentence_length() const;
   public:
   void clear_max_sentence_length();
-  ::PROTOBUF_NAMESPACE_ID::int32 max_sentence_length() const;
-  void set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t max_sentence_length() const;
+  void set_max_sentence_length(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_max_sentence_length() const;
-  void _internal_set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_max_sentence_length() const;
+  void _internal_set_max_sentence_length(int32_t value);
   public:
 
   // optional int32 max_sentencepiece_length = 20 [default = 16];
@@ -812,11 +793,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_max_sentencepiece_length() const;
   public:
   void clear_max_sentencepiece_length();
-  ::PROTOBUF_NAMESPACE_ID::int32 max_sentencepiece_length() const;
-  void set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t max_sentencepiece_length() const;
+  void set_max_sentencepiece_length(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_max_sentencepiece_length() const;
-  void _internal_set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_max_sentencepiece_length() const;
+  void _internal_set_max_sentencepiece_length(int32_t value);
   public:
 
   // optional bool shuffle_input_sentence = 19 [default = true];
@@ -903,11 +884,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_bos_id() const;
   public:
   void clear_bos_id();
-  ::PROTOBUF_NAMESPACE_ID::int32 bos_id() const;
-  void set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t bos_id() const;
+  void set_bos_id(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_bos_id() const;
-  void _internal_set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_bos_id() const;
+  void _internal_set_bos_id(int32_t value);
   public:
 
   // optional int32 eos_id = 42 [default = 2];
@@ -916,11 +897,11 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_eos_id() const;
   public:
   void clear_eos_id();
-  ::PROTOBUF_NAMESPACE_ID::int32 eos_id() const;
-  void set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t eos_id() const;
+  void set_eos_id(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_eos_id() const;
-  void _internal_set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_eos_id() const;
+  void _internal_set_eos_id(int32_t value);
   public:
 
   // optional int32 pad_id = 43 [default = -1];
@@ -929,14 +910,203 @@ class TrainerSpec PROTOBUF_FINAL :
   bool _internal_has_pad_id() const;
   public:
   void clear_pad_id();
-  ::PROTOBUF_NAMESPACE_ID::int32 pad_id() const;
-  void set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t pad_id() const;
+  void set_pad_id(int32_t value);
   private:
-  ::PROTOBUF_NAMESPACE_ID::int32 _internal_pad_id() const;
-  void _internal_set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value);
+  int32_t _internal_pad_id() const;
+  void _internal_set_pad_id(int32_t value);
   public:
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(TrainerSpec)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          TrainerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.TrainerSpec)
  private:
   class _Internal;
@@ -965,44 +1135,45 @@ class TrainerSpec PROTOBUF_FINAL :
   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr eos_piece_;
   static const ::PROTOBUF_NAMESPACE_ID::internal::LazyString _i_give_permission_to_break_this_code_default_pad_piece_;
   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr pad_piece_;
-  ::PROTOBUF_NAMESPACE_ID::int32 self_test_sample_size_;
-  ::PROTOBUF_NAMESPACE_ID::int32 mining_sentence_size_;
-  ::PROTOBUF_NAMESPACE_ID::uint64 input_sentence_size_;
-  ::PROTOBUF_NAMESPACE_ID::int32 training_sentence_size_;
+  int32_t self_test_sample_size_;
+  int32_t mining_sentence_size_;
+  uint64_t input_sentence_size_;
+  int32_t training_sentence_size_;
   bool treat_whitespace_as_suffix_;
   bool allow_whitespace_only_pieces_;
   bool split_digits_;
   bool byte_fallback_;
-  ::PROTOBUF_NAMESPACE_ID::int32 unk_id_;
+  int32_t unk_id_;
   bool use_all_vocab_;
   bool train_extremely_large_corpus_;
   int model_type_;
-  ::PROTOBUF_NAMESPACE_ID::int32 vocab_size_;
+  int32_t vocab_size_;
   float character_coverage_;
-  ::PROTOBUF_NAMESPACE_ID::int32 seed_sentencepiece_size_;
+  int32_t seed_sentencepiece_size_;
   float shrinking_factor_;
-  ::PROTOBUF_NAMESPACE_ID::int32 num_threads_;
-  ::PROTOBUF_NAMESPACE_ID::int32 num_sub_iterations_;
-  ::PROTOBUF_NAMESPACE_ID::int32 max_sentence_length_;
-  ::PROTOBUF_NAMESPACE_ID::int32 max_sentencepiece_length_;
+  int32_t num_threads_;
+  int32_t num_sub_iterations_;
+  int32_t max_sentence_length_;
+  int32_t max_sentencepiece_length_;
   bool shuffle_input_sentence_;
   bool split_by_unicode_script_;
   bool split_by_number_;
   bool split_by_whitespace_;
   bool vocabulary_output_piece_score_;
   bool hard_vocab_limit_;
-  ::PROTOBUF_NAMESPACE_ID::int32 bos_id_;
-  ::PROTOBUF_NAMESPACE_ID::int32 eos_id_;
-  ::PROTOBUF_NAMESPACE_ID::int32 pad_id_;
+  int32_t bos_id_;
+  int32_t eos_id_;
+  int32_t pad_id_;
   friend struct ::TableStruct_sentencepiece_5fmodel_2eproto;
 };
 // -------------------------------------------------------------------
 
-class NormalizerSpec PROTOBUF_FINAL :
+class NormalizerSpec final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.NormalizerSpec) */ {
  public:
   inline NormalizerSpec() : NormalizerSpec(nullptr) {}
-  virtual ~NormalizerSpec();
+  ~NormalizerSpec() override;
+  explicit PROTOBUF_CONSTEXPR NormalizerSpec(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   NormalizerSpec(const NormalizerSpec& from);
   NormalizerSpec(NormalizerSpec&& from) noexcept
@@ -1015,8 +1186,13 @@ class NormalizerSpec PROTOBUF_FINAL :
     return *this;
   }
   inline NormalizerSpec& operator=(NormalizerSpec&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -1030,8 +1206,9 @@ class NormalizerSpec PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const NormalizerSpec& default_instance();
-
+  static const NormalizerSpec& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const NormalizerSpec* internal_default_instance() {
     return reinterpret_cast<const NormalizerSpec*>(
                &_NormalizerSpec_default_instance_);
@@ -1044,7 +1221,12 @@ class NormalizerSpec PROTOBUF_FINAL :
   }
   inline void Swap(NormalizerSpec* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1052,21 +1234,16 @@ class NormalizerSpec PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(NormalizerSpec* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline NormalizerSpec* New() const final {
-    return CreateMaybeMessage<NormalizerSpec>(nullptr);
-  }
-
-  NormalizerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  NormalizerSpec* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<NormalizerSpec>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const NormalizerSpec& from);
   void MergeFrom(const NormalizerSpec& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1074,25 +1251,24 @@ class NormalizerSpec PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(NormalizerSpec* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.NormalizerSpec";
   }
   protected:
-  explicit NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit NormalizerSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -1116,16 +1292,14 @@ class NormalizerSpec PROTOBUF_FINAL :
   public:
   void clear_name();
   const std::string& name() const;
-  void set_name(const std::string& value);
-  void set_name(std::string&& value);
-  void set_name(const char* value);
-  void set_name(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_name(ArgT0&& arg0, ArgT... args);
   std::string* mutable_name();
-  std::string* release_name();
+  PROTOBUF_NODISCARD std::string* release_name();
   void set_allocated_name(std::string* name);
   private:
   const std::string& _internal_name() const;
-  void _internal_set_name(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value);
   std::string* _internal_mutable_name();
   public:
 
@@ -1136,16 +1310,14 @@ class NormalizerSpec PROTOBUF_FINAL :
   public:
   void clear_precompiled_charsmap();
   const std::string& precompiled_charsmap() const;
-  void set_precompiled_charsmap(const std::string& value);
-  void set_precompiled_charsmap(std::string&& value);
-  void set_precompiled_charsmap(const char* value);
-  void set_precompiled_charsmap(const void* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_precompiled_charsmap(ArgT0&& arg0, ArgT... args);
   std::string* mutable_precompiled_charsmap();
-  std::string* release_precompiled_charsmap();
+  PROTOBUF_NODISCARD std::string* release_precompiled_charsmap();
   void set_allocated_precompiled_charsmap(std::string* precompiled_charsmap);
   private:
   const std::string& _internal_precompiled_charsmap() const;
-  void _internal_set_precompiled_charsmap(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_precompiled_charsmap(const std::string& value);
   std::string* _internal_mutable_precompiled_charsmap();
   public:
 
@@ -1156,16 +1328,14 @@ class NormalizerSpec PROTOBUF_FINAL :
   public:
   void clear_normalization_rule_tsv();
   const std::string& normalization_rule_tsv() const;
-  void set_normalization_rule_tsv(const std::string& value);
-  void set_normalization_rule_tsv(std::string&& value);
-  void set_normalization_rule_tsv(const char* value);
-  void set_normalization_rule_tsv(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_normalization_rule_tsv(ArgT0&& arg0, ArgT... args);
   std::string* mutable_normalization_rule_tsv();
-  std::string* release_normalization_rule_tsv();
+  PROTOBUF_NODISCARD std::string* release_normalization_rule_tsv();
   void set_allocated_normalization_rule_tsv(std::string* normalization_rule_tsv);
   private:
   const std::string& _internal_normalization_rule_tsv() const;
-  void _internal_set_normalization_rule_tsv(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_normalization_rule_tsv(const std::string& value);
   std::string* _internal_mutable_normalization_rule_tsv();
   public:
 
@@ -1208,7 +1378,196 @@ class NormalizerSpec PROTOBUF_FINAL :
   void _internal_set_escape_whitespaces(bool value);
   public:
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(NormalizerSpec)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          NormalizerSpec, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.NormalizerSpec)
  private:
   class _Internal;
@@ -1230,11 +1589,12 @@ class NormalizerSpec PROTOBUF_FINAL :
 };
 // -------------------------------------------------------------------
 
-class SelfTestData_Sample PROTOBUF_FINAL :
+class SelfTestData_Sample final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SelfTestData.Sample) */ {
  public:
   inline SelfTestData_Sample() : SelfTestData_Sample(nullptr) {}
-  virtual ~SelfTestData_Sample();
+  ~SelfTestData_Sample() override;
+  explicit PROTOBUF_CONSTEXPR SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SelfTestData_Sample(const SelfTestData_Sample& from);
   SelfTestData_Sample(SelfTestData_Sample&& from) noexcept
@@ -1247,8 +1607,13 @@ class SelfTestData_Sample PROTOBUF_FINAL :
     return *this;
   }
   inline SelfTestData_Sample& operator=(SelfTestData_Sample&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -1262,8 +1627,9 @@ class SelfTestData_Sample PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const SelfTestData_Sample& default_instance();
-
+  static const SelfTestData_Sample& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SelfTestData_Sample* internal_default_instance() {
     return reinterpret_cast<const SelfTestData_Sample*>(
                &_SelfTestData_Sample_default_instance_);
@@ -1276,7 +1642,12 @@ class SelfTestData_Sample PROTOBUF_FINAL :
   }
   inline void Swap(SelfTestData_Sample* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1284,21 +1655,16 @@ class SelfTestData_Sample PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(SelfTestData_Sample* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline SelfTestData_Sample* New() const final {
-    return CreateMaybeMessage<SelfTestData_Sample>(nullptr);
-  }
-
-  SelfTestData_Sample* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  SelfTestData_Sample* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<SelfTestData_Sample>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const SelfTestData_Sample& from);
   void MergeFrom(const SelfTestData_Sample& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1306,25 +1672,24 @@ class SelfTestData_Sample PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(SelfTestData_Sample* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.SelfTestData.Sample";
   }
   protected:
-  explicit SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit SelfTestData_Sample(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -1344,16 +1709,14 @@ class SelfTestData_Sample PROTOBUF_FINAL :
   public:
   void clear_input();
   const std::string& input() const;
-  void set_input(const std::string& value);
-  void set_input(std::string&& value);
-  void set_input(const char* value);
-  void set_input(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_input(ArgT0&& arg0, ArgT... args);
   std::string* mutable_input();
-  std::string* release_input();
+  PROTOBUF_NODISCARD std::string* release_input();
   void set_allocated_input(std::string* input);
   private:
   const std::string& _internal_input() const;
-  void _internal_set_input(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_input(const std::string& value);
   std::string* _internal_mutable_input();
   public:
 
@@ -1364,16 +1727,14 @@ class SelfTestData_Sample PROTOBUF_FINAL :
   public:
   void clear_expected();
   const std::string& expected() const;
-  void set_expected(const std::string& value);
-  void set_expected(std::string&& value);
-  void set_expected(const char* value);
-  void set_expected(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_expected(ArgT0&& arg0, ArgT... args);
   std::string* mutable_expected();
-  std::string* release_expected();
+  PROTOBUF_NODISCARD std::string* release_expected();
   void set_allocated_expected(std::string* expected);
   private:
   const std::string& _internal_expected() const;
-  void _internal_set_expected(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_expected(const std::string& value);
   std::string* _internal_mutable_expected();
   public:
 
@@ -1392,11 +1753,12 @@ class SelfTestData_Sample PROTOBUF_FINAL :
 };
 // -------------------------------------------------------------------
 
-class SelfTestData PROTOBUF_FINAL :
+class SelfTestData final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.SelfTestData) */ {
  public:
   inline SelfTestData() : SelfTestData(nullptr) {}
-  virtual ~SelfTestData();
+  ~SelfTestData() override;
+  explicit PROTOBUF_CONSTEXPR SelfTestData(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   SelfTestData(const SelfTestData& from);
   SelfTestData(SelfTestData&& from) noexcept
@@ -1409,8 +1771,13 @@ class SelfTestData PROTOBUF_FINAL :
     return *this;
   }
   inline SelfTestData& operator=(SelfTestData&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -1424,8 +1791,9 @@ class SelfTestData PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const SelfTestData& default_instance();
-
+  static const SelfTestData& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const SelfTestData* internal_default_instance() {
     return reinterpret_cast<const SelfTestData*>(
                &_SelfTestData_default_instance_);
@@ -1438,7 +1806,12 @@ class SelfTestData PROTOBUF_FINAL :
   }
   inline void Swap(SelfTestData* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1446,21 +1819,16 @@ class SelfTestData PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(SelfTestData* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline SelfTestData* New() const final {
-    return CreateMaybeMessage<SelfTestData>(nullptr);
-  }
-
-  SelfTestData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  SelfTestData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<SelfTestData>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const SelfTestData& from);
   void MergeFrom(const SelfTestData& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1468,25 +1836,24 @@ class SelfTestData PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(SelfTestData* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.SelfTestData";
   }
   protected:
-  explicit SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit SelfTestData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -1518,7 +1885,196 @@ class SelfTestData PROTOBUF_FINAL :
   const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample >&
       samples() const;
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(SelfTestData)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          SelfTestData, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.SelfTestData)
  private:
   class _Internal;
@@ -1534,11 +2090,12 @@ class SelfTestData PROTOBUF_FINAL :
 };
 // -------------------------------------------------------------------
 
-class ModelProto_SentencePiece PROTOBUF_FINAL :
+class ModelProto_SentencePiece final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.ModelProto.SentencePiece) */ {
  public:
   inline ModelProto_SentencePiece() : ModelProto_SentencePiece(nullptr) {}
-  virtual ~ModelProto_SentencePiece();
+  ~ModelProto_SentencePiece() override;
+  explicit PROTOBUF_CONSTEXPR ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ModelProto_SentencePiece(const ModelProto_SentencePiece& from);
   ModelProto_SentencePiece(ModelProto_SentencePiece&& from) noexcept
@@ -1551,8 +2108,13 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
     return *this;
   }
   inline ModelProto_SentencePiece& operator=(ModelProto_SentencePiece&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -1566,8 +2128,9 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const ModelProto_SentencePiece& default_instance();
-
+  static const ModelProto_SentencePiece& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ModelProto_SentencePiece* internal_default_instance() {
     return reinterpret_cast<const ModelProto_SentencePiece*>(
                &_ModelProto_SentencePiece_default_instance_);
@@ -1580,7 +2143,12 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
   }
   inline void Swap(ModelProto_SentencePiece* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1588,21 +2156,16 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(ModelProto_SentencePiece* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline ModelProto_SentencePiece* New() const final {
-    return CreateMaybeMessage<ModelProto_SentencePiece>(nullptr);
-  }
-
-  ModelProto_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  ModelProto_SentencePiece* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<ModelProto_SentencePiece>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const ModelProto_SentencePiece& from);
   void MergeFrom(const ModelProto_SentencePiece& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1610,25 +2173,24 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(ModelProto_SentencePiece* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.ModelProto.SentencePiece";
   }
   protected:
-  explicit ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit ModelProto_SentencePiece(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -1683,16 +2245,14 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
   public:
   void clear_piece();
   const std::string& piece() const;
-  void set_piece(const std::string& value);
-  void set_piece(std::string&& value);
-  void set_piece(const char* value);
-  void set_piece(const char* value, size_t size);
+  template <typename ArgT0 = const std::string&, typename... ArgT>
+  void set_piece(ArgT0&& arg0, ArgT... args);
   std::string* mutable_piece();
-  std::string* release_piece();
+  PROTOBUF_NODISCARD std::string* release_piece();
   void set_allocated_piece(std::string* piece);
   private:
   const std::string& _internal_piece() const;
-  void _internal_set_piece(const std::string& value);
+  inline PROTOBUF_ALWAYS_INLINE void _internal_set_piece(const std::string& value);
   std::string* _internal_mutable_piece();
   public:
 
@@ -1722,7 +2282,196 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
   void _internal_set_type(::sentencepiece::ModelProto_SentencePiece_Type value);
   public:
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ModelProto_SentencePiece)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto_SentencePiece, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.ModelProto.SentencePiece)
  private:
   class _Internal;
@@ -1741,11 +2490,12 @@ class ModelProto_SentencePiece PROTOBUF_FINAL :
 };
 // -------------------------------------------------------------------
 
-class ModelProto PROTOBUF_FINAL :
+class ModelProto final :
     public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:sentencepiece.ModelProto) */ {
  public:
   inline ModelProto() : ModelProto(nullptr) {}
-  virtual ~ModelProto();
+  ~ModelProto() override;
+  explicit PROTOBUF_CONSTEXPR ModelProto(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
 
   ModelProto(const ModelProto& from);
   ModelProto(ModelProto&& from) noexcept
@@ -1758,8 +2508,13 @@ class ModelProto PROTOBUF_FINAL :
     return *this;
   }
   inline ModelProto& operator=(ModelProto&& from) noexcept {
-    if (GetArena() == from.GetArena()) {
-      if (this != &from) InternalSwap(&from);
+    if (this == &from) return *this;
+    if (GetOwningArena() == from.GetOwningArena()
+  #ifdef PROTOBUF_FORCE_COPY_IN_MOVE
+        && GetOwningArena() != nullptr
+  #endif  // !PROTOBUF_FORCE_COPY_IN_MOVE
+    ) {
+      InternalSwap(&from);
     } else {
       CopyFrom(from);
     }
@@ -1773,8 +2528,9 @@ class ModelProto PROTOBUF_FINAL :
     return _internal_metadata_.mutable_unknown_fields<std::string>();
   }
 
-  static const ModelProto& default_instance();
-
+  static const ModelProto& default_instance() {
+    return *internal_default_instance();
+  }
   static inline const ModelProto* internal_default_instance() {
     return reinterpret_cast<const ModelProto*>(
                &_ModelProto_default_instance_);
@@ -1787,7 +2543,12 @@ class ModelProto PROTOBUF_FINAL :
   }
   inline void Swap(ModelProto* other) {
     if (other == this) return;
-    if (GetArena() == other->GetArena()) {
+  #ifdef PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() != nullptr &&
+        GetOwningArena() == other->GetOwningArena()) {
+   #else  // PROTOBUF_FORCE_COPY_IN_SWAP
+    if (GetOwningArena() == other->GetOwningArena()) {
+  #endif  // !PROTOBUF_FORCE_COPY_IN_SWAP
       InternalSwap(other);
     } else {
       ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
@@ -1795,21 +2556,16 @@ class ModelProto PROTOBUF_FINAL :
   }
   void UnsafeArenaSwap(ModelProto* other) {
     if (other == this) return;
-    GOOGLE_DCHECK(GetArena() == other->GetArena());
+    GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
     InternalSwap(other);
   }
 
   // implements Message ----------------------------------------------
 
-  inline ModelProto* New() const final {
-    return CreateMaybeMessage<ModelProto>(nullptr);
-  }
-
-  ModelProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
+  ModelProto* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
     return CreateMaybeMessage<ModelProto>(arena);
   }
-  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)
-    final;
+  void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from)  final;
   void CopyFrom(const ModelProto& from);
   void MergeFrom(const ModelProto& from);
   PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
@@ -1817,25 +2573,24 @@ class ModelProto PROTOBUF_FINAL :
 
   size_t ByteSizeLong() const final;
   const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
-  ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
-      ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
-  void DiscardUnknownFields();
+  uint8_t* _InternalSerialize(
+      uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
   int GetCachedSize() const final { return _cached_size_.Get(); }
 
   private:
-  inline void SharedCtor();
-  inline void SharedDtor();
+  void SharedCtor();
+  void SharedDtor();
   void SetCachedSize(int size) const;
   void InternalSwap(ModelProto* other);
+
+  private:
   friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
   static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
     return "sentencepiece.ModelProto";
   }
   protected:
-  explicit ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena);
-  private:
-  static void ArenaDtor(void* object);
-  inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
+  explicit ModelProto(::PROTOBUF_NAMESPACE_ID::Arena* arena,
+                       bool is_message_owned = false);
   public:
 
   std::string GetTypeName() const final;
@@ -1878,7 +2633,7 @@ class ModelProto PROTOBUF_FINAL :
   public:
   void clear_trainer_spec();
   const ::sentencepiece::TrainerSpec& trainer_spec() const;
-  ::sentencepiece::TrainerSpec* release_trainer_spec();
+  PROTOBUF_NODISCARD ::sentencepiece::TrainerSpec* release_trainer_spec();
   ::sentencepiece::TrainerSpec* mutable_trainer_spec();
   void set_allocated_trainer_spec(::sentencepiece::TrainerSpec* trainer_spec);
   private:
@@ -1896,7 +2651,7 @@ class ModelProto PROTOBUF_FINAL :
   public:
   void clear_normalizer_spec();
   const ::sentencepiece::NormalizerSpec& normalizer_spec() const;
-  ::sentencepiece::NormalizerSpec* release_normalizer_spec();
+  PROTOBUF_NODISCARD ::sentencepiece::NormalizerSpec* release_normalizer_spec();
   ::sentencepiece::NormalizerSpec* mutable_normalizer_spec();
   void set_allocated_normalizer_spec(::sentencepiece::NormalizerSpec* normalizer_spec);
   private:
@@ -1914,7 +2669,7 @@ class ModelProto PROTOBUF_FINAL :
   public:
   void clear_self_test_data();
   const ::sentencepiece::SelfTestData& self_test_data() const;
-  ::sentencepiece::SelfTestData* release_self_test_data();
+  PROTOBUF_NODISCARD ::sentencepiece::SelfTestData* release_self_test_data();
   ::sentencepiece::SelfTestData* mutable_self_test_data();
   void set_allocated_self_test_data(::sentencepiece::SelfTestData* self_test_data);
   private:
@@ -1932,7 +2687,7 @@ class ModelProto PROTOBUF_FINAL :
   public:
   void clear_denormalizer_spec();
   const ::sentencepiece::NormalizerSpec& denormalizer_spec() const;
-  ::sentencepiece::NormalizerSpec* release_denormalizer_spec();
+  PROTOBUF_NODISCARD ::sentencepiece::NormalizerSpec* release_denormalizer_spec();
   ::sentencepiece::NormalizerSpec* mutable_denormalizer_spec();
   void set_allocated_denormalizer_spec(::sentencepiece::NormalizerSpec* denormalizer_spec);
   private:
@@ -1943,7 +2698,196 @@ class ModelProto PROTOBUF_FINAL :
       ::sentencepiece::NormalizerSpec* denormalizer_spec);
   ::sentencepiece::NormalizerSpec* unsafe_arena_release_denormalizer_spec();
 
-  GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ModelProto)
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline bool HasExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.Has(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void ClearExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    _extensions_.ClearExtension(id.number());
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline int ExtensionSize(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _extensions_.ExtensionSize(id.number());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_,
+                                  id.default_value());
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Mutable(id.number(), _field_type,
+                                      &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), _field_type, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::SetAllocated(id.number(), _field_type, value,
+                                    &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void UnsafeArenaSetAllocatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Singular::MutableType value) {
+    _proto_TypeTraits::UnsafeArenaSetAllocated(id.number(), _field_type,
+                                               value, &_extensions_);
+
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  PROTOBUF_NODISCARD inline
+      typename _proto_TypeTraits::Singular::MutableType
+      ReleaseExtension(
+          const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+              ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::Release(id.number(), _field_type,
+                                      &_extensions_);
+  }
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Singular::MutableType
+  UnsafeArenaReleaseExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::UnsafeArenaRelease(id.number(), _field_type,
+                                                 &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::ConstType GetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) const {
+
+    return _proto_TypeTraits::Get(id.number(), _extensions_, index);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType MutableExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index) {
+
+    return _proto_TypeTraits::Mutable(id.number(), index, &_extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void SetExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      int index, typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Set(id.number(), index, value, &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::MutableType AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+    typename _proto_TypeTraits::Repeated::MutableType to_add =
+        _proto_TypeTraits::Add(id.number(), _field_type, &_extensions_);
+
+    return to_add;
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline void AddExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id,
+      typename _proto_TypeTraits::Repeated::ConstType value) {
+    _proto_TypeTraits::Add(id.number(), _field_type, _is_packed, value,
+                           &_extensions_);
+
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline const typename _proto_TypeTraits::Repeated::RepeatedFieldType&
+  GetRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) const {
+
+    return _proto_TypeTraits::GetRepeated(id.number(), _extensions_);
+  }
+
+  template <typename _proto_TypeTraits,
+            ::PROTOBUF_NAMESPACE_ID::internal::FieldType _field_type,
+            bool _is_packed>
+  inline typename _proto_TypeTraits::Repeated::RepeatedFieldType*
+  MutableRepeatedExtension(
+      const ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<
+          ModelProto, _proto_TypeTraits, _field_type, _is_packed>& id) {
+
+    return _proto_TypeTraits::MutableRepeated(id.number(), _field_type,
+                                              _is_packed, &_extensions_);
+  }
+
   // @@protoc_insertion_point(class_scope:sentencepiece.ModelProto)
  private:
   class _Internal;
@@ -1984,8 +2928,9 @@ inline void TrainerSpec::clear_input() {
   input_.Clear();
 }
 inline std::string* TrainerSpec::add_input() {
+  std::string* _s = _internal_add_input();
   // @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.input)
-  return _internal_add_input();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_input(int index) const {
   return input_.Get(index);
@@ -1999,12 +2944,12 @@ inline std::string* TrainerSpec::mutable_input(int index) {
   return input_.Mutable(index);
 }
 inline void TrainerSpec::set_input(int index, const std::string& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input)
   input_.Mutable(index)->assign(value);
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input)
 }
 inline void TrainerSpec::set_input(int index, std::string&& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input)
   input_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input)
 }
 inline void TrainerSpec::set_input(int index, const char* value) {
   GOOGLE_DCHECK(value != nullptr);
@@ -2063,43 +3008,28 @@ inline const std::string& TrainerSpec::input_format() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.input_format)
   return _internal_input_format();
 }
-inline void TrainerSpec::set_input_format(const std::string& value) {
-  _internal_set_input_format(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_input_format(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ input_format_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input_format)
 }
 inline std::string* TrainerSpec::mutable_input_format() {
+  std::string* _s = _internal_mutable_input_format();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.input_format)
-  return _internal_mutable_input_format();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_input_format() const {
   return input_format_.Get();
 }
 inline void TrainerSpec::_internal_set_input_format(const std::string& value) {
   _has_bits_[0] |= 0x00000002u;
-  input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_input_format(std::string&& value) {
-  _has_bits_[0] |= 0x00000002u;
-  input_format_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.input_format)
-}
-inline void TrainerSpec::set_input_format(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000002u;
-  input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.input_format)
-}
-inline void TrainerSpec::set_input_format(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000002u;
-  input_format_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.input_format)
+  input_format_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_input_format() {
   _has_bits_[0] |= 0x00000002u;
-  return input_format_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return input_format_.Mutable(GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_input_format() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.input_format)
@@ -2107,7 +3037,13 @@ inline std::string* TrainerSpec::release_input_format() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000002u;
-  return input_format_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = input_format_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (input_format_.IsDefault()) {
+    input_format_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void TrainerSpec::set_allocated_input_format(std::string* input_format) {
   if (input_format != nullptr) {
@@ -2115,8 +3051,12 @@ inline void TrainerSpec::set_allocated_input_format(std::string* input_format) {
   } else {
     _has_bits_[0] &= ~0x00000002u;
   }
-  input_format_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), input_format,
-      GetArena());
+  input_format_.SetAllocated(input_format, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (input_format_.IsDefault()) {
+    input_format_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.input_format)
 }
 
@@ -2136,43 +3076,28 @@ inline const std::string& TrainerSpec::model_prefix() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.model_prefix)
   return _internal_model_prefix();
 }
-inline void TrainerSpec::set_model_prefix(const std::string& value) {
-  _internal_set_model_prefix(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_model_prefix(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ model_prefix_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.model_prefix)
 }
 inline std::string* TrainerSpec::mutable_model_prefix() {
+  std::string* _s = _internal_mutable_model_prefix();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.model_prefix)
-  return _internal_mutable_model_prefix();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_model_prefix() const {
   return model_prefix_.Get();
 }
 inline void TrainerSpec::_internal_set_model_prefix(const std::string& value) {
   _has_bits_[0] |= 0x00000001u;
-  model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_model_prefix(std::string&& value) {
-  _has_bits_[0] |= 0x00000001u;
-  model_prefix_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.model_prefix)
-}
-inline void TrainerSpec::set_model_prefix(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000001u;
-  model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.model_prefix)
-}
-inline void TrainerSpec::set_model_prefix(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000001u;
-  model_prefix_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.model_prefix)
+  model_prefix_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_model_prefix() {
   _has_bits_[0] |= 0x00000001u;
-  return model_prefix_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return model_prefix_.Mutable(GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_model_prefix() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.model_prefix)
@@ -2180,7 +3105,13 @@ inline std::string* TrainerSpec::release_model_prefix() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000001u;
-  return model_prefix_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = model_prefix_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (model_prefix_.IsDefault()) {
+    model_prefix_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void TrainerSpec::set_allocated_model_prefix(std::string* model_prefix) {
   if (model_prefix != nullptr) {
@@ -2188,8 +3119,12 @@ inline void TrainerSpec::set_allocated_model_prefix(std::string* model_prefix) {
   } else {
     _has_bits_[0] &= ~0x00000001u;
   }
-  model_prefix_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), model_prefix,
-      GetArena());
+  model_prefix_.SetAllocated(model_prefix, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (model_prefix_.IsDefault()) {
+    model_prefix_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.model_prefix)
 }
 
@@ -2234,18 +3169,18 @@ inline void TrainerSpec::clear_vocab_size() {
   vocab_size_ = 8000;
   _has_bits_[0] &= ~0x00100000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_vocab_size() const {
+inline int32_t TrainerSpec::_internal_vocab_size() const {
   return vocab_size_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::vocab_size() const {
+inline int32_t TrainerSpec::vocab_size() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.vocab_size)
   return _internal_vocab_size();
 }
-inline void TrainerSpec::_internal_set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_vocab_size(int32_t value) {
   _has_bits_[0] |= 0x00100000u;
   vocab_size_ = value;
 }
-inline void TrainerSpec::set_vocab_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_vocab_size(int32_t value) {
   _internal_set_vocab_size(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.vocab_size)
 }
@@ -2261,8 +3196,9 @@ inline void TrainerSpec::clear_accept_language() {
   accept_language_.Clear();
 }
 inline std::string* TrainerSpec::add_accept_language() {
+  std::string* _s = _internal_add_accept_language();
   // @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.accept_language)
-  return _internal_add_accept_language();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_accept_language(int index) const {
   return accept_language_.Get(index);
@@ -2276,12 +3212,12 @@ inline std::string* TrainerSpec::mutable_accept_language(int index) {
   return accept_language_.Mutable(index);
 }
 inline void TrainerSpec::set_accept_language(int index, const std::string& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.accept_language)
   accept_language_.Mutable(index)->assign(value);
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.accept_language)
 }
 inline void TrainerSpec::set_accept_language(int index, std::string&& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.accept_language)
   accept_language_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.accept_language)
 }
 inline void TrainerSpec::set_accept_language(int index, const char* value) {
   GOOGLE_DCHECK(value != nullptr);
@@ -2336,18 +3272,18 @@ inline void TrainerSpec::clear_self_test_sample_size() {
   self_test_sample_size_ = 0;
   _has_bits_[0] &= ~0x00000100u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_self_test_sample_size() const {
+inline int32_t TrainerSpec::_internal_self_test_sample_size() const {
   return self_test_sample_size_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::self_test_sample_size() const {
+inline int32_t TrainerSpec::self_test_sample_size() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.self_test_sample_size)
   return _internal_self_test_sample_size();
 }
-inline void TrainerSpec::_internal_set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_self_test_sample_size(int32_t value) {
   _has_bits_[0] |= 0x00000100u;
   self_test_sample_size_ = value;
 }
-inline void TrainerSpec::set_self_test_sample_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_self_test_sample_size(int32_t value) {
   _internal_set_self_test_sample_size(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.self_test_sample_size)
 }
@@ -2389,21 +3325,21 @@ inline bool TrainerSpec::has_input_sentence_size() const {
   return _internal_has_input_sentence_size();
 }
 inline void TrainerSpec::clear_input_sentence_size() {
-  input_sentence_size_ = PROTOBUF_ULONGLONG(0);
+  input_sentence_size_ = uint64_t{0u};
   _has_bits_[0] &= ~0x00000400u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint64 TrainerSpec::_internal_input_sentence_size() const {
+inline uint64_t TrainerSpec::_internal_input_sentence_size() const {
   return input_sentence_size_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::uint64 TrainerSpec::input_sentence_size() const {
+inline uint64_t TrainerSpec::input_sentence_size() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.input_sentence_size)
   return _internal_input_sentence_size();
 }
-inline void TrainerSpec::_internal_set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value) {
+inline void TrainerSpec::_internal_set_input_sentence_size(uint64_t value) {
   _has_bits_[0] |= 0x00000400u;
   input_sentence_size_ = value;
 }
-inline void TrainerSpec::set_input_sentence_size(::PROTOBUF_NAMESPACE_ID::uint64 value) {
+inline void TrainerSpec::set_input_sentence_size(uint64_t value) {
   _internal_set_input_sentence_size(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.input_sentence_size)
 }
@@ -2448,18 +3384,18 @@ inline void TrainerSpec::clear_mining_sentence_size() {
   mining_sentence_size_ = 0;
   _has_bits_[0] &= ~0x00000200u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_mining_sentence_size() const {
+inline int32_t TrainerSpec::_internal_mining_sentence_size() const {
   return mining_sentence_size_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::mining_sentence_size() const {
+inline int32_t TrainerSpec::mining_sentence_size() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.mining_sentence_size)
   return _internal_mining_sentence_size();
 }
-inline void TrainerSpec::_internal_set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_mining_sentence_size(int32_t value) {
   _has_bits_[0] |= 0x00000200u;
   mining_sentence_size_ = value;
 }
-inline void TrainerSpec::set_mining_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_mining_sentence_size(int32_t value) {
   _internal_set_mining_sentence_size(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.mining_sentence_size)
 }
@@ -2476,18 +3412,18 @@ inline void TrainerSpec::clear_training_sentence_size() {
   training_sentence_size_ = 0;
   _has_bits_[0] &= ~0x00000800u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_training_sentence_size() const {
+inline int32_t TrainerSpec::_internal_training_sentence_size() const {
   return training_sentence_size_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::training_sentence_size() const {
+inline int32_t TrainerSpec::training_sentence_size() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.training_sentence_size)
   return _internal_training_sentence_size();
 }
-inline void TrainerSpec::_internal_set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_training_sentence_size(int32_t value) {
   _has_bits_[0] |= 0x00000800u;
   training_sentence_size_ = value;
 }
-inline void TrainerSpec::set_training_sentence_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_training_sentence_size(int32_t value) {
   _internal_set_training_sentence_size(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.training_sentence_size)
 }
@@ -2504,18 +3440,18 @@ inline void TrainerSpec::clear_seed_sentencepiece_size() {
   seed_sentencepiece_size_ = 1000000;
   _has_bits_[0] &= ~0x00400000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_seed_sentencepiece_size() const {
+inline int32_t TrainerSpec::_internal_seed_sentencepiece_size() const {
   return seed_sentencepiece_size_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::seed_sentencepiece_size() const {
+inline int32_t TrainerSpec::seed_sentencepiece_size() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.seed_sentencepiece_size)
   return _internal_seed_sentencepiece_size();
 }
-inline void TrainerSpec::_internal_set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_seed_sentencepiece_size(int32_t value) {
   _has_bits_[0] |= 0x00400000u;
   seed_sentencepiece_size_ = value;
 }
-inline void TrainerSpec::set_seed_sentencepiece_size(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_seed_sentencepiece_size(int32_t value) {
   _internal_set_seed_sentencepiece_size(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.seed_sentencepiece_size)
 }
@@ -2560,18 +3496,18 @@ inline void TrainerSpec::clear_max_sentence_length() {
   max_sentence_length_ = 4192;
   _has_bits_[0] &= ~0x04000000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_max_sentence_length() const {
+inline int32_t TrainerSpec::_internal_max_sentence_length() const {
   return max_sentence_length_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::max_sentence_length() const {
+inline int32_t TrainerSpec::max_sentence_length() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.max_sentence_length)
   return _internal_max_sentence_length();
 }
-inline void TrainerSpec::_internal_set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_max_sentence_length(int32_t value) {
   _has_bits_[0] |= 0x04000000u;
   max_sentence_length_ = value;
 }
-inline void TrainerSpec::set_max_sentence_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_max_sentence_length(int32_t value) {
   _internal_set_max_sentence_length(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.max_sentence_length)
 }
@@ -2588,18 +3524,18 @@ inline void TrainerSpec::clear_num_threads() {
   num_threads_ = 16;
   _has_bits_[0] &= ~0x01000000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_num_threads() const {
+inline int32_t TrainerSpec::_internal_num_threads() const {
   return num_threads_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::num_threads() const {
+inline int32_t TrainerSpec::num_threads() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.num_threads)
   return _internal_num_threads();
 }
-inline void TrainerSpec::_internal_set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_num_threads(int32_t value) {
   _has_bits_[0] |= 0x01000000u;
   num_threads_ = value;
 }
-inline void TrainerSpec::set_num_threads(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_num_threads(int32_t value) {
   _internal_set_num_threads(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.num_threads)
 }
@@ -2616,18 +3552,18 @@ inline void TrainerSpec::clear_num_sub_iterations() {
   num_sub_iterations_ = 2;
   _has_bits_[0] &= ~0x02000000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_num_sub_iterations() const {
+inline int32_t TrainerSpec::_internal_num_sub_iterations() const {
   return num_sub_iterations_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::num_sub_iterations() const {
+inline int32_t TrainerSpec::num_sub_iterations() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.num_sub_iterations)
   return _internal_num_sub_iterations();
 }
-inline void TrainerSpec::_internal_set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_num_sub_iterations(int32_t value) {
   _has_bits_[0] |= 0x02000000u;
   num_sub_iterations_ = value;
 }
-inline void TrainerSpec::set_num_sub_iterations(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_num_sub_iterations(int32_t value) {
   _internal_set_num_sub_iterations(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.num_sub_iterations)
 }
@@ -2644,18 +3580,18 @@ inline void TrainerSpec::clear_max_sentencepiece_length() {
   max_sentencepiece_length_ = 16;
   _has_bits_[0] &= ~0x08000000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_max_sentencepiece_length() const {
+inline int32_t TrainerSpec::_internal_max_sentencepiece_length() const {
   return max_sentencepiece_length_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::max_sentencepiece_length() const {
+inline int32_t TrainerSpec::max_sentencepiece_length() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.max_sentencepiece_length)
   return _internal_max_sentencepiece_length();
 }
-inline void TrainerSpec::_internal_set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_max_sentencepiece_length(int32_t value) {
   _has_bits_[0] |= 0x08000000u;
   max_sentencepiece_length_ = value;
 }
-inline void TrainerSpec::set_max_sentencepiece_length(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_max_sentencepiece_length(int32_t value) {
   _internal_set_max_sentencepiece_length(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.max_sentencepiece_length)
 }
@@ -2839,8 +3775,9 @@ inline void TrainerSpec::clear_control_symbols() {
   control_symbols_.Clear();
 }
 inline std::string* TrainerSpec::add_control_symbols() {
+  std::string* _s = _internal_add_control_symbols();
   // @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.control_symbols)
-  return _internal_add_control_symbols();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_control_symbols(int index) const {
   return control_symbols_.Get(index);
@@ -2854,12 +3791,12 @@ inline std::string* TrainerSpec::mutable_control_symbols(int index) {
   return control_symbols_.Mutable(index);
 }
 inline void TrainerSpec::set_control_symbols(int index, const std::string& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.control_symbols)
   control_symbols_.Mutable(index)->assign(value);
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.control_symbols)
 }
 inline void TrainerSpec::set_control_symbols(int index, std::string&& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.control_symbols)
   control_symbols_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.control_symbols)
 }
 inline void TrainerSpec::set_control_symbols(int index, const char* value) {
   GOOGLE_DCHECK(value != nullptr);
@@ -2913,8 +3850,9 @@ inline void TrainerSpec::clear_user_defined_symbols() {
   user_defined_symbols_.Clear();
 }
 inline std::string* TrainerSpec::add_user_defined_symbols() {
+  std::string* _s = _internal_add_user_defined_symbols();
   // @@protoc_insertion_point(field_add_mutable:sentencepiece.TrainerSpec.user_defined_symbols)
-  return _internal_add_user_defined_symbols();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_user_defined_symbols(int index) const {
   return user_defined_symbols_.Get(index);
@@ -2928,12 +3866,12 @@ inline std::string* TrainerSpec::mutable_user_defined_symbols(int index) {
   return user_defined_symbols_.Mutable(index);
 }
 inline void TrainerSpec::set_user_defined_symbols(int index, const std::string& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.user_defined_symbols)
   user_defined_symbols_.Mutable(index)->assign(value);
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.user_defined_symbols)
 }
 inline void TrainerSpec::set_user_defined_symbols(int index, std::string&& value) {
-  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.user_defined_symbols)
   user_defined_symbols_.Mutable(index)->assign(std::move(value));
+  // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.user_defined_symbols)
 }
 inline void TrainerSpec::set_user_defined_symbols(int index, const char* value) {
   GOOGLE_DCHECK(value != nullptr);
@@ -2992,43 +3930,28 @@ inline const std::string& TrainerSpec::required_chars() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.required_chars)
   return _internal_required_chars();
 }
-inline void TrainerSpec::set_required_chars(const std::string& value) {
-  _internal_set_required_chars(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_required_chars(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ required_chars_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.required_chars)
 }
 inline std::string* TrainerSpec::mutable_required_chars() {
+  std::string* _s = _internal_mutable_required_chars();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.required_chars)
-  return _internal_mutable_required_chars();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_required_chars() const {
   return required_chars_.Get();
 }
 inline void TrainerSpec::_internal_set_required_chars(const std::string& value) {
   _has_bits_[0] |= 0x00000004u;
-  required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_required_chars(std::string&& value) {
-  _has_bits_[0] |= 0x00000004u;
-  required_chars_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.required_chars)
-}
-inline void TrainerSpec::set_required_chars(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000004u;
-  required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.required_chars)
-}
-inline void TrainerSpec::set_required_chars(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000004u;
-  required_chars_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.required_chars)
+  required_chars_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_required_chars() {
   _has_bits_[0] |= 0x00000004u;
-  return required_chars_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return required_chars_.Mutable(GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_required_chars() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.required_chars)
@@ -3036,7 +3959,13 @@ inline std::string* TrainerSpec::release_required_chars() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000004u;
-  return required_chars_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = required_chars_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (required_chars_.IsDefault()) {
+    required_chars_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void TrainerSpec::set_allocated_required_chars(std::string* required_chars) {
   if (required_chars != nullptr) {
@@ -3044,8 +3973,12 @@ inline void TrainerSpec::set_allocated_required_chars(std::string* required_char
   } else {
     _has_bits_[0] &= ~0x00000004u;
   }
-  required_chars_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), required_chars,
-      GetArena());
+  required_chars_.SetAllocated(required_chars, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (required_chars_.IsDefault()) {
+    required_chars_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.required_chars)
 }
 
@@ -3173,18 +4106,18 @@ inline void TrainerSpec::clear_unk_id() {
   unk_id_ = 0;
   _has_bits_[0] &= ~0x00010000u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_unk_id() const {
+inline int32_t TrainerSpec::_internal_unk_id() const {
   return unk_id_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::unk_id() const {
+inline int32_t TrainerSpec::unk_id() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.unk_id)
   return _internal_unk_id();
 }
-inline void TrainerSpec::_internal_set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_unk_id(int32_t value) {
   _has_bits_[0] |= 0x00010000u;
   unk_id_ = value;
 }
-inline void TrainerSpec::set_unk_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_unk_id(int32_t value) {
   _internal_set_unk_id(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.unk_id)
 }
@@ -3201,18 +4134,18 @@ inline void TrainerSpec::clear_bos_id() {
   bos_id_ = 1;
   _has_bits_[1] &= ~0x00000004u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_bos_id() const {
+inline int32_t TrainerSpec::_internal_bos_id() const {
   return bos_id_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::bos_id() const {
+inline int32_t TrainerSpec::bos_id() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.bos_id)
   return _internal_bos_id();
 }
-inline void TrainerSpec::_internal_set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_bos_id(int32_t value) {
   _has_bits_[1] |= 0x00000004u;
   bos_id_ = value;
 }
-inline void TrainerSpec::set_bos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_bos_id(int32_t value) {
   _internal_set_bos_id(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.bos_id)
 }
@@ -3229,18 +4162,18 @@ inline void TrainerSpec::clear_eos_id() {
   eos_id_ = 2;
   _has_bits_[1] &= ~0x00000008u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_eos_id() const {
+inline int32_t TrainerSpec::_internal_eos_id() const {
   return eos_id_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::eos_id() const {
+inline int32_t TrainerSpec::eos_id() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.eos_id)
   return _internal_eos_id();
 }
-inline void TrainerSpec::_internal_set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_eos_id(int32_t value) {
   _has_bits_[1] |= 0x00000008u;
   eos_id_ = value;
 }
-inline void TrainerSpec::set_eos_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_eos_id(int32_t value) {
   _internal_set_eos_id(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.eos_id)
 }
@@ -3257,18 +4190,18 @@ inline void TrainerSpec::clear_pad_id() {
   pad_id_ = -1;
   _has_bits_[1] &= ~0x00000010u;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::_internal_pad_id() const {
+inline int32_t TrainerSpec::_internal_pad_id() const {
   return pad_id_;
 }
-inline ::PROTOBUF_NAMESPACE_ID::int32 TrainerSpec::pad_id() const {
+inline int32_t TrainerSpec::pad_id() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.pad_id)
   return _internal_pad_id();
 }
-inline void TrainerSpec::_internal_set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::_internal_set_pad_id(int32_t value) {
   _has_bits_[1] |= 0x00000010u;
   pad_id_ = value;
 }
-inline void TrainerSpec::set_pad_id(::PROTOBUF_NAMESPACE_ID::int32 value) {
+inline void TrainerSpec::set_pad_id(int32_t value) {
   _internal_set_pad_id(value);
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.pad_id)
 }
@@ -3282,51 +4215,36 @@ inline bool TrainerSpec::has_unk_piece() const {
   return _internal_has_unk_piece();
 }
 inline void TrainerSpec::clear_unk_piece() {
-  unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArena());
+  unk_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArenaForAllocation());
   _has_bits_[0] &= ~0x00000010u;
 }
 inline const std::string& TrainerSpec::unk_piece() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.unk_piece)
-  if (unk_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_unk_piece_.get();
+  if (unk_piece_.IsDefault()) return _i_give_permission_to_break_this_code_default_unk_piece_.get();
   return _internal_unk_piece();
 }
-inline void TrainerSpec::set_unk_piece(const std::string& value) {
-  _internal_set_unk_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_unk_piece(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000010u;
+ unk_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.unk_piece)
 }
 inline std::string* TrainerSpec::mutable_unk_piece() {
+  std::string* _s = _internal_mutable_unk_piece();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.unk_piece)
-  return _internal_mutable_unk_piece();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_unk_piece() const {
   return unk_piece_.Get();
 }
 inline void TrainerSpec::_internal_set_unk_piece(const std::string& value) {
   _has_bits_[0] |= 0x00000010u;
-  unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_unk_piece(std::string&& value) {
-  _has_bits_[0] |= 0x00000010u;
-  unk_piece_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.unk_piece)
-}
-inline void TrainerSpec::set_unk_piece(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000010u;
-  unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.unk_piece)
-}
-inline void TrainerSpec::set_unk_piece(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000010u;
-  unk_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.unk_piece)
+  unk_piece_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_unk_piece() {
   _has_bits_[0] |= 0x00000010u;
-  return unk_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArena());
+  return unk_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_piece_, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_unk_piece() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.unk_piece)
@@ -3334,7 +4252,8 @@ inline std::string* TrainerSpec::release_unk_piece() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000010u;
-  return unk_piece_.ReleaseNonDefault(nullptr, GetArena());
+  auto* p = unk_piece_.Release();
+  return p;
 }
 inline void TrainerSpec::set_allocated_unk_piece(std::string* unk_piece) {
   if (unk_piece != nullptr) {
@@ -3342,8 +4261,7 @@ inline void TrainerSpec::set_allocated_unk_piece(std::string* unk_piece) {
   } else {
     _has_bits_[0] &= ~0x00000010u;
   }
-  unk_piece_.SetAllocated(nullptr, unk_piece,
-      GetArena());
+  unk_piece_.SetAllocated(unk_piece, GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.unk_piece)
 }
 
@@ -3356,51 +4274,36 @@ inline bool TrainerSpec::has_bos_piece() const {
   return _internal_has_bos_piece();
 }
 inline void TrainerSpec::clear_bos_piece() {
-  bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArena());
+  bos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArenaForAllocation());
   _has_bits_[0] &= ~0x00000020u;
 }
 inline const std::string& TrainerSpec::bos_piece() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.bos_piece)
-  if (bos_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_bos_piece_.get();
+  if (bos_piece_.IsDefault()) return _i_give_permission_to_break_this_code_default_bos_piece_.get();
   return _internal_bos_piece();
 }
-inline void TrainerSpec::set_bos_piece(const std::string& value) {
-  _internal_set_bos_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_bos_piece(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000020u;
+ bos_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.bos_piece)
 }
 inline std::string* TrainerSpec::mutable_bos_piece() {
+  std::string* _s = _internal_mutable_bos_piece();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.bos_piece)
-  return _internal_mutable_bos_piece();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_bos_piece() const {
   return bos_piece_.Get();
 }
 inline void TrainerSpec::_internal_set_bos_piece(const std::string& value) {
   _has_bits_[0] |= 0x00000020u;
-  bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_bos_piece(std::string&& value) {
-  _has_bits_[0] |= 0x00000020u;
-  bos_piece_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.bos_piece)
-}
-inline void TrainerSpec::set_bos_piece(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000020u;
-  bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.bos_piece)
-}
-inline void TrainerSpec::set_bos_piece(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000020u;
-  bos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.bos_piece)
+  bos_piece_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_bos_piece() {
   _has_bits_[0] |= 0x00000020u;
-  return bos_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArena());
+  return bos_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_bos_piece_, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_bos_piece() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.bos_piece)
@@ -3408,7 +4311,8 @@ inline std::string* TrainerSpec::release_bos_piece() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000020u;
-  return bos_piece_.ReleaseNonDefault(nullptr, GetArena());
+  auto* p = bos_piece_.Release();
+  return p;
 }
 inline void TrainerSpec::set_allocated_bos_piece(std::string* bos_piece) {
   if (bos_piece != nullptr) {
@@ -3416,8 +4320,7 @@ inline void TrainerSpec::set_allocated_bos_piece(std::string* bos_piece) {
   } else {
     _has_bits_[0] &= ~0x00000020u;
   }
-  bos_piece_.SetAllocated(nullptr, bos_piece,
-      GetArena());
+  bos_piece_.SetAllocated(bos_piece, GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.bos_piece)
 }
 
@@ -3430,51 +4333,36 @@ inline bool TrainerSpec::has_eos_piece() const {
   return _internal_has_eos_piece();
 }
 inline void TrainerSpec::clear_eos_piece() {
-  eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArena());
+  eos_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArenaForAllocation());
   _has_bits_[0] &= ~0x00000040u;
 }
 inline const std::string& TrainerSpec::eos_piece() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.eos_piece)
-  if (eos_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_eos_piece_.get();
+  if (eos_piece_.IsDefault()) return _i_give_permission_to_break_this_code_default_eos_piece_.get();
   return _internal_eos_piece();
 }
-inline void TrainerSpec::set_eos_piece(const std::string& value) {
-  _internal_set_eos_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_eos_piece(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000040u;
+ eos_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.eos_piece)
 }
 inline std::string* TrainerSpec::mutable_eos_piece() {
+  std::string* _s = _internal_mutable_eos_piece();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.eos_piece)
-  return _internal_mutable_eos_piece();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_eos_piece() const {
   return eos_piece_.Get();
 }
 inline void TrainerSpec::_internal_set_eos_piece(const std::string& value) {
   _has_bits_[0] |= 0x00000040u;
-  eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_eos_piece(std::string&& value) {
-  _has_bits_[0] |= 0x00000040u;
-  eos_piece_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.eos_piece)
-}
-inline void TrainerSpec::set_eos_piece(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000040u;
-  eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.eos_piece)
-}
-inline void TrainerSpec::set_eos_piece(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000040u;
-  eos_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.eos_piece)
+  eos_piece_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_eos_piece() {
   _has_bits_[0] |= 0x00000040u;
-  return eos_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArena());
+  return eos_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_eos_piece_, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_eos_piece() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.eos_piece)
@@ -3482,7 +4370,8 @@ inline std::string* TrainerSpec::release_eos_piece() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000040u;
-  return eos_piece_.ReleaseNonDefault(nullptr, GetArena());
+  auto* p = eos_piece_.Release();
+  return p;
 }
 inline void TrainerSpec::set_allocated_eos_piece(std::string* eos_piece) {
   if (eos_piece != nullptr) {
@@ -3490,8 +4379,7 @@ inline void TrainerSpec::set_allocated_eos_piece(std::string* eos_piece) {
   } else {
     _has_bits_[0] &= ~0x00000040u;
   }
-  eos_piece_.SetAllocated(nullptr, eos_piece,
-      GetArena());
+  eos_piece_.SetAllocated(eos_piece, GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.eos_piece)
 }
 
@@ -3504,51 +4392,36 @@ inline bool TrainerSpec::has_pad_piece() const {
   return _internal_has_pad_piece();
 }
 inline void TrainerSpec::clear_pad_piece() {
-  pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArena());
+  pad_piece_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArenaForAllocation());
   _has_bits_[0] &= ~0x00000080u;
 }
 inline const std::string& TrainerSpec::pad_piece() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.pad_piece)
-  if (pad_piece_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_pad_piece_.get();
+  if (pad_piece_.IsDefault()) return _i_give_permission_to_break_this_code_default_pad_piece_.get();
   return _internal_pad_piece();
 }
-inline void TrainerSpec::set_pad_piece(const std::string& value) {
-  _internal_set_pad_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_pad_piece(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000080u;
+ pad_piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.pad_piece)
 }
 inline std::string* TrainerSpec::mutable_pad_piece() {
+  std::string* _s = _internal_mutable_pad_piece();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.pad_piece)
-  return _internal_mutable_pad_piece();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_pad_piece() const {
   return pad_piece_.Get();
 }
 inline void TrainerSpec::_internal_set_pad_piece(const std::string& value) {
   _has_bits_[0] |= 0x00000080u;
-  pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_pad_piece(std::string&& value) {
-  _has_bits_[0] |= 0x00000080u;
-  pad_piece_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.pad_piece)
-}
-inline void TrainerSpec::set_pad_piece(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000080u;
-  pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.pad_piece)
-}
-inline void TrainerSpec::set_pad_piece(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000080u;
-  pad_piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.pad_piece)
+  pad_piece_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_pad_piece() {
   _has_bits_[0] |= 0x00000080u;
-  return pad_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArena());
+  return pad_piece_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_pad_piece_, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_pad_piece() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.pad_piece)
@@ -3556,7 +4429,8 @@ inline std::string* TrainerSpec::release_pad_piece() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000080u;
-  return pad_piece_.ReleaseNonDefault(nullptr, GetArena());
+  auto* p = pad_piece_.Release();
+  return p;
 }
 inline void TrainerSpec::set_allocated_pad_piece(std::string* pad_piece) {
   if (pad_piece != nullptr) {
@@ -3564,8 +4438,7 @@ inline void TrainerSpec::set_allocated_pad_piece(std::string* pad_piece) {
   } else {
     _has_bits_[0] &= ~0x00000080u;
   }
-  pad_piece_.SetAllocated(nullptr, pad_piece,
-      GetArena());
+  pad_piece_.SetAllocated(pad_piece, GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.pad_piece)
 }
 
@@ -3578,51 +4451,36 @@ inline bool TrainerSpec::has_unk_surface() const {
   return _internal_has_unk_surface();
 }
 inline void TrainerSpec::clear_unk_surface() {
-  unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArena());
+  unk_surface_.ClearToDefault(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArenaForAllocation());
   _has_bits_[0] &= ~0x00000008u;
 }
 inline const std::string& TrainerSpec::unk_surface() const {
   // @@protoc_insertion_point(field_get:sentencepiece.TrainerSpec.unk_surface)
-  if (unk_surface_.IsDefault(nullptr)) return _i_give_permission_to_break_this_code_default_unk_surface_.get();
+  if (unk_surface_.IsDefault()) return _i_give_permission_to_break_this_code_default_unk_surface_.get();
   return _internal_unk_surface();
 }
-inline void TrainerSpec::set_unk_surface(const std::string& value) {
-  _internal_set_unk_surface(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void TrainerSpec::set_unk_surface(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000008u;
+ unk_surface_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.TrainerSpec.unk_surface)
 }
 inline std::string* TrainerSpec::mutable_unk_surface() {
+  std::string* _s = _internal_mutable_unk_surface();
   // @@protoc_insertion_point(field_mutable:sentencepiece.TrainerSpec.unk_surface)
-  return _internal_mutable_unk_surface();
+  return _s;
 }
 inline const std::string& TrainerSpec::_internal_unk_surface() const {
   return unk_surface_.Get();
 }
 inline void TrainerSpec::_internal_set_unk_surface(const std::string& value) {
   _has_bits_[0] |= 0x00000008u;
-  unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, value, GetArena());
-}
-inline void TrainerSpec::set_unk_surface(std::string&& value) {
-  _has_bits_[0] |= 0x00000008u;
-  unk_surface_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.TrainerSpec.unk_surface)
-}
-inline void TrainerSpec::set_unk_surface(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000008u;
-  unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.TrainerSpec.unk_surface)
-}
-inline void TrainerSpec::set_unk_surface(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000008u;
-  unk_surface_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::NonEmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.TrainerSpec.unk_surface)
+  unk_surface_.Set(value, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::_internal_mutable_unk_surface() {
   _has_bits_[0] |= 0x00000008u;
-  return unk_surface_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArena());
+  return unk_surface_.Mutable(::sentencepiece::TrainerSpec::_i_give_permission_to_break_this_code_default_unk_surface_, GetArenaForAllocation());
 }
 inline std::string* TrainerSpec::release_unk_surface() {
   // @@protoc_insertion_point(field_release:sentencepiece.TrainerSpec.unk_surface)
@@ -3630,7 +4488,8 @@ inline std::string* TrainerSpec::release_unk_surface() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000008u;
-  return unk_surface_.ReleaseNonDefault(nullptr, GetArena());
+  auto* p = unk_surface_.Release();
+  return p;
 }
 inline void TrainerSpec::set_allocated_unk_surface(std::string* unk_surface) {
   if (unk_surface != nullptr) {
@@ -3638,8 +4497,7 @@ inline void TrainerSpec::set_allocated_unk_surface(std::string* unk_surface) {
   } else {
     _has_bits_[0] &= ~0x00000008u;
   }
-  unk_surface_.SetAllocated(nullptr, unk_surface,
-      GetArena());
+  unk_surface_.SetAllocated(unk_surface, GetArenaForAllocation());
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.TrainerSpec.unk_surface)
 }
 
@@ -3691,43 +4549,28 @@ inline const std::string& NormalizerSpec::name() const {
   // @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.name)
   return _internal_name();
 }
-inline void NormalizerSpec::set_name(const std::string& value) {
-  _internal_set_name(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NormalizerSpec::set_name(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ name_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.NormalizerSpec.name)
 }
 inline std::string* NormalizerSpec::mutable_name() {
+  std::string* _s = _internal_mutable_name();
   // @@protoc_insertion_point(field_mutable:sentencepiece.NormalizerSpec.name)
-  return _internal_mutable_name();
+  return _s;
 }
 inline const std::string& NormalizerSpec::_internal_name() const {
   return name_.Get();
 }
 inline void NormalizerSpec::_internal_set_name(const std::string& value) {
   _has_bits_[0] |= 0x00000001u;
-  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void NormalizerSpec::set_name(std::string&& value) {
-  _has_bits_[0] |= 0x00000001u;
-  name_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.NormalizerSpec.name)
-}
-inline void NormalizerSpec::set_name(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000001u;
-  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.NormalizerSpec.name)
-}
-inline void NormalizerSpec::set_name(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000001u;
-  name_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.NormalizerSpec.name)
+  name_.Set(value, GetArenaForAllocation());
 }
 inline std::string* NormalizerSpec::_internal_mutable_name() {
   _has_bits_[0] |= 0x00000001u;
-  return name_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return name_.Mutable(GetArenaForAllocation());
 }
 inline std::string* NormalizerSpec::release_name() {
   // @@protoc_insertion_point(field_release:sentencepiece.NormalizerSpec.name)
@@ -3735,7 +4578,13 @@ inline std::string* NormalizerSpec::release_name() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000001u;
-  return name_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = name_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault()) {
+    name_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void NormalizerSpec::set_allocated_name(std::string* name) {
   if (name != nullptr) {
@@ -3743,8 +4592,12 @@ inline void NormalizerSpec::set_allocated_name(std::string* name) {
   } else {
     _has_bits_[0] &= ~0x00000001u;
   }
-  name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
-      GetArena());
+  name_.SetAllocated(name, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (name_.IsDefault()) {
+    name_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.NormalizerSpec.name)
 }
 
@@ -3764,43 +4617,28 @@ inline const std::string& NormalizerSpec::precompiled_charsmap() const {
   // @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.precompiled_charsmap)
   return _internal_precompiled_charsmap();
 }
-inline void NormalizerSpec::set_precompiled_charsmap(const std::string& value) {
-  _internal_set_precompiled_charsmap(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NormalizerSpec::set_precompiled_charsmap(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ precompiled_charsmap_.SetBytes(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.NormalizerSpec.precompiled_charsmap)
 }
 inline std::string* NormalizerSpec::mutable_precompiled_charsmap() {
+  std::string* _s = _internal_mutable_precompiled_charsmap();
   // @@protoc_insertion_point(field_mutable:sentencepiece.NormalizerSpec.precompiled_charsmap)
-  return _internal_mutable_precompiled_charsmap();
+  return _s;
 }
 inline const std::string& NormalizerSpec::_internal_precompiled_charsmap() const {
   return precompiled_charsmap_.Get();
 }
 inline void NormalizerSpec::_internal_set_precompiled_charsmap(const std::string& value) {
   _has_bits_[0] |= 0x00000002u;
-  precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void NormalizerSpec::set_precompiled_charsmap(std::string&& value) {
-  _has_bits_[0] |= 0x00000002u;
-  precompiled_charsmap_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.NormalizerSpec.precompiled_charsmap)
-}
-inline void NormalizerSpec::set_precompiled_charsmap(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000002u;
-  precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.NormalizerSpec.precompiled_charsmap)
-}
-inline void NormalizerSpec::set_precompiled_charsmap(const void* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000002u;
-  precompiled_charsmap_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.NormalizerSpec.precompiled_charsmap)
+  precompiled_charsmap_.Set(value, GetArenaForAllocation());
 }
 inline std::string* NormalizerSpec::_internal_mutable_precompiled_charsmap() {
   _has_bits_[0] |= 0x00000002u;
-  return precompiled_charsmap_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return precompiled_charsmap_.Mutable(GetArenaForAllocation());
 }
 inline std::string* NormalizerSpec::release_precompiled_charsmap() {
   // @@protoc_insertion_point(field_release:sentencepiece.NormalizerSpec.precompiled_charsmap)
@@ -3808,7 +4646,13 @@ inline std::string* NormalizerSpec::release_precompiled_charsmap() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000002u;
-  return precompiled_charsmap_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = precompiled_charsmap_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (precompiled_charsmap_.IsDefault()) {
+    precompiled_charsmap_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void NormalizerSpec::set_allocated_precompiled_charsmap(std::string* precompiled_charsmap) {
   if (precompiled_charsmap != nullptr) {
@@ -3816,8 +4660,12 @@ inline void NormalizerSpec::set_allocated_precompiled_charsmap(std::string* prec
   } else {
     _has_bits_[0] &= ~0x00000002u;
   }
-  precompiled_charsmap_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), precompiled_charsmap,
-      GetArena());
+  precompiled_charsmap_.SetAllocated(precompiled_charsmap, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (precompiled_charsmap_.IsDefault()) {
+    precompiled_charsmap_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.NormalizerSpec.precompiled_charsmap)
 }
 
@@ -3921,43 +4769,28 @@ inline const std::string& NormalizerSpec::normalization_rule_tsv() const {
   // @@protoc_insertion_point(field_get:sentencepiece.NormalizerSpec.normalization_rule_tsv)
   return _internal_normalization_rule_tsv();
 }
-inline void NormalizerSpec::set_normalization_rule_tsv(const std::string& value) {
-  _internal_set_normalization_rule_tsv(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void NormalizerSpec::set_normalization_rule_tsv(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000004u;
+ normalization_rule_tsv_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.NormalizerSpec.normalization_rule_tsv)
 }
 inline std::string* NormalizerSpec::mutable_normalization_rule_tsv() {
+  std::string* _s = _internal_mutable_normalization_rule_tsv();
   // @@protoc_insertion_point(field_mutable:sentencepiece.NormalizerSpec.normalization_rule_tsv)
-  return _internal_mutable_normalization_rule_tsv();
+  return _s;
 }
 inline const std::string& NormalizerSpec::_internal_normalization_rule_tsv() const {
   return normalization_rule_tsv_.Get();
 }
 inline void NormalizerSpec::_internal_set_normalization_rule_tsv(const std::string& value) {
   _has_bits_[0] |= 0x00000004u;
-  normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void NormalizerSpec::set_normalization_rule_tsv(std::string&& value) {
-  _has_bits_[0] |= 0x00000004u;
-  normalization_rule_tsv_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.NormalizerSpec.normalization_rule_tsv)
-}
-inline void NormalizerSpec::set_normalization_rule_tsv(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000004u;
-  normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.NormalizerSpec.normalization_rule_tsv)
-}
-inline void NormalizerSpec::set_normalization_rule_tsv(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000004u;
-  normalization_rule_tsv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.NormalizerSpec.normalization_rule_tsv)
+  normalization_rule_tsv_.Set(value, GetArenaForAllocation());
 }
 inline std::string* NormalizerSpec::_internal_mutable_normalization_rule_tsv() {
   _has_bits_[0] |= 0x00000004u;
-  return normalization_rule_tsv_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return normalization_rule_tsv_.Mutable(GetArenaForAllocation());
 }
 inline std::string* NormalizerSpec::release_normalization_rule_tsv() {
   // @@protoc_insertion_point(field_release:sentencepiece.NormalizerSpec.normalization_rule_tsv)
@@ -3965,7 +4798,13 @@ inline std::string* NormalizerSpec::release_normalization_rule_tsv() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000004u;
-  return normalization_rule_tsv_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = normalization_rule_tsv_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (normalization_rule_tsv_.IsDefault()) {
+    normalization_rule_tsv_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void NormalizerSpec::set_allocated_normalization_rule_tsv(std::string* normalization_rule_tsv) {
   if (normalization_rule_tsv != nullptr) {
@@ -3973,8 +4812,12 @@ inline void NormalizerSpec::set_allocated_normalization_rule_tsv(std::string* no
   } else {
     _has_bits_[0] &= ~0x00000004u;
   }
-  normalization_rule_tsv_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), normalization_rule_tsv,
-      GetArena());
+  normalization_rule_tsv_.SetAllocated(normalization_rule_tsv, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (normalization_rule_tsv_.IsDefault()) {
+    normalization_rule_tsv_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.NormalizerSpec.normalization_rule_tsv)
 }
 
@@ -3998,43 +4841,28 @@ inline const std::string& SelfTestData_Sample::input() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SelfTestData.Sample.input)
   return _internal_input();
 }
-inline void SelfTestData_Sample::set_input(const std::string& value) {
-  _internal_set_input(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SelfTestData_Sample::set_input(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ input_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.SelfTestData.Sample.input)
 }
 inline std::string* SelfTestData_Sample::mutable_input() {
+  std::string* _s = _internal_mutable_input();
   // @@protoc_insertion_point(field_mutable:sentencepiece.SelfTestData.Sample.input)
-  return _internal_mutable_input();
+  return _s;
 }
 inline const std::string& SelfTestData_Sample::_internal_input() const {
   return input_.Get();
 }
 inline void SelfTestData_Sample::_internal_set_input(const std::string& value) {
   _has_bits_[0] |= 0x00000001u;
-  input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SelfTestData_Sample::set_input(std::string&& value) {
-  _has_bits_[0] |= 0x00000001u;
-  input_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SelfTestData.Sample.input)
-}
-inline void SelfTestData_Sample::set_input(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000001u;
-  input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.SelfTestData.Sample.input)
-}
-inline void SelfTestData_Sample::set_input(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000001u;
-  input_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.SelfTestData.Sample.input)
+  input_.Set(value, GetArenaForAllocation());
 }
 inline std::string* SelfTestData_Sample::_internal_mutable_input() {
   _has_bits_[0] |= 0x00000001u;
-  return input_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return input_.Mutable(GetArenaForAllocation());
 }
 inline std::string* SelfTestData_Sample::release_input() {
   // @@protoc_insertion_point(field_release:sentencepiece.SelfTestData.Sample.input)
@@ -4042,7 +4870,13 @@ inline std::string* SelfTestData_Sample::release_input() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000001u;
-  return input_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = input_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (input_.IsDefault()) {
+    input_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void SelfTestData_Sample::set_allocated_input(std::string* input) {
   if (input != nullptr) {
@@ -4050,8 +4884,12 @@ inline void SelfTestData_Sample::set_allocated_input(std::string* input) {
   } else {
     _has_bits_[0] &= ~0x00000001u;
   }
-  input_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), input,
-      GetArena());
+  input_.SetAllocated(input, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (input_.IsDefault()) {
+    input_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.SelfTestData.Sample.input)
 }
 
@@ -4071,43 +4909,28 @@ inline const std::string& SelfTestData_Sample::expected() const {
   // @@protoc_insertion_point(field_get:sentencepiece.SelfTestData.Sample.expected)
   return _internal_expected();
 }
-inline void SelfTestData_Sample::set_expected(const std::string& value) {
-  _internal_set_expected(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void SelfTestData_Sample::set_expected(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000002u;
+ expected_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.SelfTestData.Sample.expected)
 }
 inline std::string* SelfTestData_Sample::mutable_expected() {
+  std::string* _s = _internal_mutable_expected();
   // @@protoc_insertion_point(field_mutable:sentencepiece.SelfTestData.Sample.expected)
-  return _internal_mutable_expected();
+  return _s;
 }
 inline const std::string& SelfTestData_Sample::_internal_expected() const {
   return expected_.Get();
 }
 inline void SelfTestData_Sample::_internal_set_expected(const std::string& value) {
   _has_bits_[0] |= 0x00000002u;
-  expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void SelfTestData_Sample::set_expected(std::string&& value) {
-  _has_bits_[0] |= 0x00000002u;
-  expected_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.SelfTestData.Sample.expected)
-}
-inline void SelfTestData_Sample::set_expected(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000002u;
-  expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.SelfTestData.Sample.expected)
-}
-inline void SelfTestData_Sample::set_expected(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000002u;
-  expected_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.SelfTestData.Sample.expected)
+  expected_.Set(value, GetArenaForAllocation());
 }
 inline std::string* SelfTestData_Sample::_internal_mutable_expected() {
   _has_bits_[0] |= 0x00000002u;
-  return expected_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return expected_.Mutable(GetArenaForAllocation());
 }
 inline std::string* SelfTestData_Sample::release_expected() {
   // @@protoc_insertion_point(field_release:sentencepiece.SelfTestData.Sample.expected)
@@ -4115,7 +4938,13 @@ inline std::string* SelfTestData_Sample::release_expected() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000002u;
-  return expected_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = expected_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (expected_.IsDefault()) {
+    expected_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void SelfTestData_Sample::set_allocated_expected(std::string* expected) {
   if (expected != nullptr) {
@@ -4123,8 +4952,12 @@ inline void SelfTestData_Sample::set_allocated_expected(std::string* expected) {
   } else {
     _has_bits_[0] &= ~0x00000002u;
   }
-  expected_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), expected,
-      GetArena());
+  expected_.SetAllocated(expected, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (expected_.IsDefault()) {
+    expected_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.SelfTestData.Sample.expected)
 }
 
@@ -4162,8 +4995,9 @@ inline ::sentencepiece::SelfTestData_Sample* SelfTestData::_internal_add_samples
   return samples_.Add();
 }
 inline ::sentencepiece::SelfTestData_Sample* SelfTestData::add_samples() {
+  ::sentencepiece::SelfTestData_Sample* _add = _internal_add_samples();
   // @@protoc_insertion_point(field_add:sentencepiece.SelfTestData.samples)
-  return _internal_add_samples();
+  return _add;
 }
 inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::SelfTestData_Sample >&
 SelfTestData::samples() const {
@@ -4191,43 +5025,28 @@ inline const std::string& ModelProto_SentencePiece::piece() const {
   // @@protoc_insertion_point(field_get:sentencepiece.ModelProto.SentencePiece.piece)
   return _internal_piece();
 }
-inline void ModelProto_SentencePiece::set_piece(const std::string& value) {
-  _internal_set_piece(value);
+template <typename ArgT0, typename... ArgT>
+inline PROTOBUF_ALWAYS_INLINE
+void ModelProto_SentencePiece::set_piece(ArgT0&& arg0, ArgT... args) {
+ _has_bits_[0] |= 0x00000001u;
+ piece_.Set(static_cast<ArgT0 &&>(arg0), args..., GetArenaForAllocation());
   // @@protoc_insertion_point(field_set:sentencepiece.ModelProto.SentencePiece.piece)
 }
 inline std::string* ModelProto_SentencePiece::mutable_piece() {
+  std::string* _s = _internal_mutable_piece();
   // @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.SentencePiece.piece)
-  return _internal_mutable_piece();
+  return _s;
 }
 inline const std::string& ModelProto_SentencePiece::_internal_piece() const {
   return piece_.Get();
 }
 inline void ModelProto_SentencePiece::_internal_set_piece(const std::string& value) {
   _has_bits_[0] |= 0x00000001u;
-  piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
-}
-inline void ModelProto_SentencePiece::set_piece(std::string&& value) {
-  _has_bits_[0] |= 0x00000001u;
-  piece_.Set(
-    ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
-  // @@protoc_insertion_point(field_set_rvalue:sentencepiece.ModelProto.SentencePiece.piece)
-}
-inline void ModelProto_SentencePiece::set_piece(const char* value) {
-  GOOGLE_DCHECK(value != nullptr);
-  _has_bits_[0] |= 0x00000001u;
-  piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
-  // @@protoc_insertion_point(field_set_char:sentencepiece.ModelProto.SentencePiece.piece)
-}
-inline void ModelProto_SentencePiece::set_piece(const char* value,
-    size_t size) {
-  _has_bits_[0] |= 0x00000001u;
-  piece_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
-      reinterpret_cast<const char*>(value), size), GetArena());
-  // @@protoc_insertion_point(field_set_pointer:sentencepiece.ModelProto.SentencePiece.piece)
+  piece_.Set(value, GetArenaForAllocation());
 }
 inline std::string* ModelProto_SentencePiece::_internal_mutable_piece() {
   _has_bits_[0] |= 0x00000001u;
-  return piece_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
+  return piece_.Mutable(GetArenaForAllocation());
 }
 inline std::string* ModelProto_SentencePiece::release_piece() {
   // @@protoc_insertion_point(field_release:sentencepiece.ModelProto.SentencePiece.piece)
@@ -4235,7 +5054,13 @@ inline std::string* ModelProto_SentencePiece::release_piece() {
     return nullptr;
   }
   _has_bits_[0] &= ~0x00000001u;
-  return piece_.ReleaseNonDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
+  auto* p = piece_.Release();
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (piece_.IsDefault()) {
+    piece_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  return p;
 }
 inline void ModelProto_SentencePiece::set_allocated_piece(std::string* piece) {
   if (piece != nullptr) {
@@ -4243,8 +5068,12 @@ inline void ModelProto_SentencePiece::set_allocated_piece(std::string* piece) {
   } else {
     _has_bits_[0] &= ~0x00000001u;
   }
-  piece_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), piece,
-      GetArena());
+  piece_.SetAllocated(piece, GetArenaForAllocation());
+#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
+  if (piece_.IsDefault()) {
+    piece_.Set("", GetArenaForAllocation());
+  }
+#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
   // @@protoc_insertion_point(field_set_allocated:sentencepiece.ModelProto.SentencePiece.piece)
 }
 
@@ -4339,8 +5168,9 @@ inline ::sentencepiece::ModelProto_SentencePiece* ModelProto::_internal_add_piec
   return pieces_.Add();
 }
 inline ::sentencepiece::ModelProto_SentencePiece* ModelProto::add_pieces() {
+  ::sentencepiece::ModelProto_SentencePiece* _add = _internal_add_pieces();
   // @@protoc_insertion_point(field_add:sentencepiece.ModelProto.pieces)
-  return _internal_add_pieces();
+  return _add;
 }
 inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::sentencepiece::ModelProto_SentencePiece >&
 ModelProto::pieces() const {
@@ -4372,7 +5202,7 @@ inline const ::sentencepiece::TrainerSpec& ModelProto::trainer_spec() const {
 }
 inline void ModelProto::unsafe_arena_set_allocated_trainer_spec(
     ::sentencepiece::TrainerSpec* trainer_spec) {
-  if (GetArena() == nullptr) {
+  if (GetArenaForAllocation() == nullptr) {
     delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(trainer_spec_);
   }
   trainer_spec_ = trainer_spec;
@@ -4387,9 +5217,15 @@ inline ::sentencepiece::TrainerSpec* ModelProto::release_trainer_spec() {
   _has_bits_[0] &= ~0x00000001u;
   ::sentencepiece::TrainerSpec* temp = trainer_spec_;
   trainer_spec_ = nullptr;
-  if (GetArena() != nullptr) {
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
     temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::sentencepiece::TrainerSpec* ModelProto::unsafe_arena_release_trainer_spec() {
@@ -4402,23 +5238,24 @@ inline ::sentencepiece::TrainerSpec* ModelProto::unsafe_arena_release_trainer_sp
 inline ::sentencepiece::TrainerSpec* ModelProto::_internal_mutable_trainer_spec() {
   _has_bits_[0] |= 0x00000001u;
   if (trainer_spec_ == nullptr) {
-    auto* p = CreateMaybeMessage<::sentencepiece::TrainerSpec>(GetArena());
+    auto* p = CreateMaybeMessage<::sentencepiece::TrainerSpec>(GetArenaForAllocation());
     trainer_spec_ = p;
   }
   return trainer_spec_;
 }
 inline ::sentencepiece::TrainerSpec* ModelProto::mutable_trainer_spec() {
+  ::sentencepiece::TrainerSpec* _msg = _internal_mutable_trainer_spec();
   // @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.trainer_spec)
-  return _internal_mutable_trainer_spec();
+  return _msg;
 }
 inline void ModelProto::set_allocated_trainer_spec(::sentencepiece::TrainerSpec* trainer_spec) {
-  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   if (message_arena == nullptr) {
     delete trainer_spec_;
   }
   if (trainer_spec) {
     ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
-      ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(trainer_spec);
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(trainer_spec);
     if (message_arena != submessage_arena) {
       trainer_spec = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, trainer_spec, submessage_arena);
@@ -4455,7 +5292,7 @@ inline const ::sentencepiece::NormalizerSpec& ModelProto::normalizer_spec() cons
 }
 inline void ModelProto::unsafe_arena_set_allocated_normalizer_spec(
     ::sentencepiece::NormalizerSpec* normalizer_spec) {
-  if (GetArena() == nullptr) {
+  if (GetArenaForAllocation() == nullptr) {
     delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(normalizer_spec_);
   }
   normalizer_spec_ = normalizer_spec;
@@ -4470,9 +5307,15 @@ inline ::sentencepiece::NormalizerSpec* ModelProto::release_normalizer_spec() {
   _has_bits_[0] &= ~0x00000002u;
   ::sentencepiece::NormalizerSpec* temp = normalizer_spec_;
   normalizer_spec_ = nullptr;
-  if (GetArena() != nullptr) {
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
     temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::sentencepiece::NormalizerSpec* ModelProto::unsafe_arena_release_normalizer_spec() {
@@ -4485,23 +5328,24 @@ inline ::sentencepiece::NormalizerSpec* ModelProto::unsafe_arena_release_normali
 inline ::sentencepiece::NormalizerSpec* ModelProto::_internal_mutable_normalizer_spec() {
   _has_bits_[0] |= 0x00000002u;
   if (normalizer_spec_ == nullptr) {
-    auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArena());
+    auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArenaForAllocation());
     normalizer_spec_ = p;
   }
   return normalizer_spec_;
 }
 inline ::sentencepiece::NormalizerSpec* ModelProto::mutable_normalizer_spec() {
+  ::sentencepiece::NormalizerSpec* _msg = _internal_mutable_normalizer_spec();
   // @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.normalizer_spec)
-  return _internal_mutable_normalizer_spec();
+  return _msg;
 }
 inline void ModelProto::set_allocated_normalizer_spec(::sentencepiece::NormalizerSpec* normalizer_spec) {
-  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   if (message_arena == nullptr) {
     delete normalizer_spec_;
   }
   if (normalizer_spec) {
     ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
-      ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(normalizer_spec);
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(normalizer_spec);
     if (message_arena != submessage_arena) {
       normalizer_spec = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, normalizer_spec, submessage_arena);
@@ -4538,7 +5382,7 @@ inline const ::sentencepiece::SelfTestData& ModelProto::self_test_data() const {
 }
 inline void ModelProto::unsafe_arena_set_allocated_self_test_data(
     ::sentencepiece::SelfTestData* self_test_data) {
-  if (GetArena() == nullptr) {
+  if (GetArenaForAllocation() == nullptr) {
     delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(self_test_data_);
   }
   self_test_data_ = self_test_data;
@@ -4553,9 +5397,15 @@ inline ::sentencepiece::SelfTestData* ModelProto::release_self_test_data() {
   _has_bits_[0] &= ~0x00000004u;
   ::sentencepiece::SelfTestData* temp = self_test_data_;
   self_test_data_ = nullptr;
-  if (GetArena() != nullptr) {
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
     temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::sentencepiece::SelfTestData* ModelProto::unsafe_arena_release_self_test_data() {
@@ -4568,23 +5418,24 @@ inline ::sentencepiece::SelfTestData* ModelProto::unsafe_arena_release_self_test
 inline ::sentencepiece::SelfTestData* ModelProto::_internal_mutable_self_test_data() {
   _has_bits_[0] |= 0x00000004u;
   if (self_test_data_ == nullptr) {
-    auto* p = CreateMaybeMessage<::sentencepiece::SelfTestData>(GetArena());
+    auto* p = CreateMaybeMessage<::sentencepiece::SelfTestData>(GetArenaForAllocation());
     self_test_data_ = p;
   }
   return self_test_data_;
 }
 inline ::sentencepiece::SelfTestData* ModelProto::mutable_self_test_data() {
+  ::sentencepiece::SelfTestData* _msg = _internal_mutable_self_test_data();
   // @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.self_test_data)
-  return _internal_mutable_self_test_data();
+  return _msg;
 }
 inline void ModelProto::set_allocated_self_test_data(::sentencepiece::SelfTestData* self_test_data) {
-  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   if (message_arena == nullptr) {
     delete self_test_data_;
   }
   if (self_test_data) {
     ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
-      ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(self_test_data);
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(self_test_data);
     if (message_arena != submessage_arena) {
       self_test_data = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, self_test_data, submessage_arena);
@@ -4621,7 +5472,7 @@ inline const ::sentencepiece::NormalizerSpec& ModelProto::denormalizer_spec() co
 }
 inline void ModelProto::unsafe_arena_set_allocated_denormalizer_spec(
     ::sentencepiece::NormalizerSpec* denormalizer_spec) {
-  if (GetArena() == nullptr) {
+  if (GetArenaForAllocation() == nullptr) {
     delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(denormalizer_spec_);
   }
   denormalizer_spec_ = denormalizer_spec;
@@ -4636,9 +5487,15 @@ inline ::sentencepiece::NormalizerSpec* ModelProto::release_denormalizer_spec()
   _has_bits_[0] &= ~0x00000008u;
   ::sentencepiece::NormalizerSpec* temp = denormalizer_spec_;
   denormalizer_spec_ = nullptr;
-  if (GetArena() != nullptr) {
+#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
+  auto* old =  reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
+  temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
+  if (GetArenaForAllocation() == nullptr) { delete old; }
+#else  // PROTOBUF_FORCE_COPY_IN_RELEASE
+  if (GetArenaForAllocation() != nullptr) {
     temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
   }
+#endif  // !PROTOBUF_FORCE_COPY_IN_RELEASE
   return temp;
 }
 inline ::sentencepiece::NormalizerSpec* ModelProto::unsafe_arena_release_denormalizer_spec() {
@@ -4651,23 +5508,24 @@ inline ::sentencepiece::NormalizerSpec* ModelProto::unsafe_arena_release_denorma
 inline ::sentencepiece::NormalizerSpec* ModelProto::_internal_mutable_denormalizer_spec() {
   _has_bits_[0] |= 0x00000008u;
   if (denormalizer_spec_ == nullptr) {
-    auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArena());
+    auto* p = CreateMaybeMessage<::sentencepiece::NormalizerSpec>(GetArenaForAllocation());
     denormalizer_spec_ = p;
   }
   return denormalizer_spec_;
 }
 inline ::sentencepiece::NormalizerSpec* ModelProto::mutable_denormalizer_spec() {
+  ::sentencepiece::NormalizerSpec* _msg = _internal_mutable_denormalizer_spec();
   // @@protoc_insertion_point(field_mutable:sentencepiece.ModelProto.denormalizer_spec)
-  return _internal_mutable_denormalizer_spec();
+  return _msg;
 }
 inline void ModelProto::set_allocated_denormalizer_spec(::sentencepiece::NormalizerSpec* denormalizer_spec) {
-  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena();
+  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
   if (message_arena == nullptr) {
     delete denormalizer_spec_;
   }
   if (denormalizer_spec) {
     ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
-      ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(denormalizer_spec);
+        ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(denormalizer_spec);
     if (message_arena != submessage_arena) {
       denormalizer_spec = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
           message_arena, denormalizer_spec, submessage_arena);
